summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/av1_cx_iface.c
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-18 21:53:44 -0500
committertrav90 <travawine@palemoon.org>2018-10-18 21:53:44 -0500
commitec910d81405c736a4490383a250299a7837c2e64 (patch)
tree4f27cc226f93a863121aef6c56313e4153a69b3e /third_party/aom/av1/av1_cx_iface.c
parent01eb57073ba97b2d6cbf20f745dfcc508197adc3 (diff)
downloadUXP-ec910d81405c736a4490383a250299a7837c2e64.tar
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.gz
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.lz
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.xz
UXP-ec910d81405c736a4490383a250299a7837c2e64.zip
Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614
Diffstat (limited to 'third_party/aom/av1/av1_cx_iface.c')
-rw-r--r--third_party/aom/av1/av1_cx_iface.c270
1 files changed, 162 insertions, 108 deletions
diff --git a/third_party/aom/av1/av1_cx_iface.c b/third_party/aom/av1/av1_cx_iface.c
index 81fffd1f2..0f6c1c4d7 100644
--- a/third_party/aom/av1/av1_cx_iface.c
+++ b/third_party/aom/av1/av1_cx_iface.c
@@ -8,7 +8,6 @@
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
-
#include <stdlib.h>
#include <string.h>
@@ -23,6 +22,9 @@
#include "av1/encoder/firstpass.h"
#include "av1/av1_iface_common.h"
+#define MAG_SIZE (4)
+#define MAX_INDEX_SIZE (256)
+
struct av1_extracfg {
int cpu_used; // available cpu percentage in 1/16
unsigned int enable_auto_alt_ref;
@@ -32,8 +34,8 @@ struct av1_extracfg {
unsigned int noise_sensitivity;
unsigned int sharpness;
unsigned int static_thresh;
- unsigned int tile_columns;
- unsigned int tile_rows;
+ unsigned int tile_columns; // log2 number of tile columns
+ unsigned int tile_rows; // log2 number of tile rows
#if CONFIG_DEPENDENT_HORZTILES
unsigned int dependent_horz_tiles;
#endif
@@ -55,6 +57,9 @@ struct av1_extracfg {
unsigned int qm_min;
unsigned int qm_max;
#endif
+#if CONFIG_DIST_8X8
+ unsigned int enable_dist_8x8;
+#endif
unsigned int num_tg;
unsigned int mtu_size;
#if CONFIG_TEMPMV_SIGNALING
@@ -69,10 +74,8 @@ struct av1_extracfg {
aom_bit_depth_t bit_depth;
aom_tune_content content;
aom_color_space_t color_space;
-#if CONFIG_COLORSPACE_HEADERS
aom_transfer_function_t transfer_function;
aom_chroma_sample_position_t chroma_sample_position;
-#endif
int color_range;
int render_width;
int render_height;
@@ -119,6 +122,9 @@ static struct av1_extracfg default_extra_cfg = {
DEFAULT_QM_FIRST, // qm_min
DEFAULT_QM_LAST, // qm_max
#endif
+#if CONFIG_DIST_8X8
+ 0,
+#endif
1, // max number of tile groups
0, // mtu_size
#if CONFIG_TEMPMV_SIGNALING
@@ -129,14 +135,12 @@ static struct av1_extracfg default_extra_cfg = {
#if CONFIG_EXT_DELTA_Q
NO_DELTA_Q, // deltaq_mode
#endif
- CONFIG_XIPHRC, // frame_periodic_delta_q
- AOM_BITS_8, // Bit depth
- AOM_CONTENT_DEFAULT, // content
- AOM_CS_UNKNOWN, // color space
-#if CONFIG_COLORSPACE_HEADERS
- AOM_TF_UNKNOWN, // transfer function
- AOM_CSP_UNKNOWN, // chroma sample position
-#endif
+ CONFIG_XIPHRC, // frame_periodic_delta_q
+ AOM_BITS_8, // Bit depth
+ AOM_CONTENT_DEFAULT, // content
+ AOM_CS_UNKNOWN, // color space
+ AOM_TF_UNKNOWN, // transfer function
+ AOM_CSP_UNKNOWN, // chroma sample position
0, // color range
0, // render width
0, // render height
@@ -222,9 +226,9 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
RANGE_CHECK_HI(cfg, rc_max_quantizer, 63);
RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer);
RANGE_CHECK_BOOL(extra_cfg, lossless);
- RANGE_CHECK(extra_cfg, aq_mode, 0, AQ_MODE_COUNT - 1);
+ RANGE_CHECK_HI(extra_cfg, aq_mode, AQ_MODE_COUNT - 1);
#if CONFIG_EXT_DELTA_Q
- RANGE_CHECK(extra_cfg, deltaq_mode, 0, DELTAQ_MODE_COUNT - 1);
+ RANGE_CHECK_HI(extra_cfg, deltaq_mode, DELTAQ_MODE_COUNT - 1);
#endif
RANGE_CHECK_HI(extra_cfg, frame_periodic_boost, 1);
RANGE_CHECK_HI(cfg, g_threads, 64);
@@ -246,17 +250,19 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
(MAX_LAG_BUFFERS - 1));
}
- RANGE_CHECK_HI(cfg, rc_resize_mode, RESIZE_DYNAMIC);
- RANGE_CHECK(cfg, rc_resize_numerator, SCALE_DENOMINATOR / 2,
- SCALE_DENOMINATOR);
- RANGE_CHECK(cfg, rc_resize_kf_numerator, SCALE_DENOMINATOR / 2,
- SCALE_DENOMINATOR);
+ RANGE_CHECK_HI(cfg, rc_resize_mode, RESIZE_MODES - 1);
+ RANGE_CHECK(cfg, rc_resize_denominator, SCALE_NUMERATOR,
+ SCALE_NUMERATOR << 1);
+ RANGE_CHECK(cfg, rc_resize_kf_denominator, SCALE_NUMERATOR,
+ SCALE_NUMERATOR << 1);
#if CONFIG_FRAME_SUPERRES
- RANGE_CHECK_HI(cfg, rc_superres_mode, SUPERRES_DYNAMIC);
- RANGE_CHECK(cfg, rc_superres_numerator, SCALE_DENOMINATOR / 2,
- SCALE_DENOMINATOR);
- RANGE_CHECK(cfg, rc_superres_kf_numerator, SCALE_DENOMINATOR / 2,
- SCALE_DENOMINATOR);
+ RANGE_CHECK_HI(cfg, rc_superres_mode, SUPERRES_MODES - 1);
+ RANGE_CHECK(cfg, rc_superres_denominator, SCALE_NUMERATOR,
+ SCALE_NUMERATOR << 1);
+ RANGE_CHECK(cfg, rc_superres_kf_denominator, SCALE_NUMERATOR,
+ SCALE_NUMERATOR << 1);
+ RANGE_CHECK(cfg, rc_superres_qthresh, 1, 63);
+ RANGE_CHECK(cfg, rc_superres_kf_qthresh, 1, 63);
#endif // CONFIG_FRAME_SUPERRES
// AV1 does not support a lower bound on the keyframe interval in
@@ -299,8 +305,13 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
#endif // CONFIG_EXT_PARTITION
} else {
#endif // CONFIG_EXT_TILE
+#if CONFIG_MAX_TILE
RANGE_CHECK_HI(extra_cfg, tile_columns, 6);
- RANGE_CHECK_HI(extra_cfg, tile_rows, 2);
+ RANGE_CHECK_HI(extra_cfg, tile_rows, 6);
+#else // CONFIG_MAX_TILE
+ RANGE_CHECK_HI(extra_cfg, tile_columns, 6);
+ RANGE_CHECK_HI(extra_cfg, tile_rows, 2);
+#endif // CONFIG_MAX_TILE
#if CONFIG_EXT_TILE
}
#endif // CONFIG_EXT_TILE
@@ -323,6 +334,14 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
if (extra_cfg->tuning == AOM_TUNE_SSIM)
ERROR("Option --tune=ssim is not currently supported in AV1.");
+// TODO(anybody) : remove this flag when PVQ supports pallete coding tool
+#if CONFIG_PVQ
+ if (extra_cfg->content == AOM_CONTENT_SCREEN)
+ ERROR(
+ "Option --tune-content=screen is not currently supported when PVQ is "
+ "enabled.");
+#endif // CONFIG_PVQ
+
if (cfg->g_pass == AOM_RC_LAST_PASS) {
#if !CONFIG_XIPHRC
const size_t packet_sz = sizeof(FIRSTPASS_STATS);
@@ -477,7 +496,12 @@ static aom_codec_err_t set_encoder_config(
oxcf->qm_minlevel = extra_cfg->qm_min;
oxcf->qm_maxlevel = extra_cfg->qm_max;
#endif
-
+#if CONFIG_DIST_8X8
+ oxcf->using_dist_8x8 = extra_cfg->enable_dist_8x8;
+ if (extra_cfg->tuning == AOM_TUNE_CDEF_DIST ||
+ extra_cfg->tuning == AOM_TUNE_DAALA_DIST)
+ oxcf->using_dist_8x8 = 1;
+#endif
oxcf->num_tile_groups = extra_cfg->num_tg;
#if CONFIG_EXT_TILE
// In large-scale tile encoding mode, num_tile_groups is always 1.
@@ -492,20 +516,31 @@ static aom_codec_err_t set_encoder_config(
oxcf->over_shoot_pct = cfg->rc_overshoot_pct;
oxcf->resize_mode = (RESIZE_MODE)cfg->rc_resize_mode;
- oxcf->resize_scale_numerator = (uint8_t)cfg->rc_resize_numerator;
- oxcf->resize_kf_scale_numerator = (uint8_t)cfg->rc_resize_kf_numerator;
+ oxcf->resize_scale_denominator = (uint8_t)cfg->rc_resize_denominator;
+ oxcf->resize_kf_scale_denominator = (uint8_t)cfg->rc_resize_kf_denominator;
if (oxcf->resize_mode == RESIZE_FIXED &&
- oxcf->resize_scale_numerator == SCALE_DENOMINATOR &&
- oxcf->resize_kf_scale_numerator == SCALE_DENOMINATOR)
+ oxcf->resize_scale_denominator == SCALE_NUMERATOR &&
+ oxcf->resize_kf_scale_denominator == SCALE_NUMERATOR)
oxcf->resize_mode = RESIZE_NONE;
#if CONFIG_FRAME_SUPERRES
oxcf->superres_mode = (SUPERRES_MODE)cfg->rc_superres_mode;
- oxcf->superres_scale_numerator = (uint8_t)cfg->rc_superres_numerator;
- oxcf->superres_kf_scale_numerator = (uint8_t)cfg->rc_superres_kf_numerator;
+ oxcf->superres_scale_denominator = (uint8_t)cfg->rc_superres_denominator;
+ oxcf->superres_kf_scale_denominator =
+ (uint8_t)cfg->rc_superres_kf_denominator;
+ oxcf->superres_qthresh =
+ extra_cfg->lossless ? 255
+ : av1_quantizer_to_qindex(cfg->rc_superres_qthresh);
+ oxcf->superres_kf_qthresh =
+ extra_cfg->lossless
+ ? 255
+ : av1_quantizer_to_qindex(cfg->rc_superres_kf_qthresh);
if (oxcf->superres_mode == SUPERRES_FIXED &&
- oxcf->superres_scale_numerator == SCALE_DENOMINATOR &&
- oxcf->superres_kf_scale_numerator == SCALE_DENOMINATOR)
+ oxcf->superres_scale_denominator == SCALE_NUMERATOR &&
+ oxcf->superres_kf_scale_denominator == SCALE_NUMERATOR)
+ oxcf->superres_mode = SUPERRES_NONE;
+ if (oxcf->superres_mode == SUPERRES_QTHRESH &&
+ oxcf->superres_qthresh == 255 && oxcf->superres_kf_qthresh == 255)
oxcf->superres_mode = SUPERRES_NONE;
#endif // CONFIG_FRAME_SUPERRES
@@ -539,10 +574,17 @@ static aom_codec_err_t set_encoder_config(
#endif
oxcf->color_space = extra_cfg->color_space;
+
#if CONFIG_COLORSPACE_HEADERS
oxcf->transfer_function = extra_cfg->transfer_function;
oxcf->chroma_sample_position = extra_cfg->chroma_sample_position;
+#else
+ if (extra_cfg->transfer_function != AOM_TF_UNKNOWN)
+ return AOM_CODEC_UNSUP_FEATURE;
+ if (extra_cfg->chroma_sample_position != AOM_CSP_UNKNOWN)
+ return AOM_CODEC_UNSUP_FEATURE;
#endif
+
oxcf->color_range = extra_cfg->color_range;
oxcf->render_width = extra_cfg->render_width;
oxcf->render_height = extra_cfg->render_height;
@@ -588,6 +630,16 @@ static aom_codec_err_t set_encoder_config(
}
#endif // CONFIG_EXT_TILE
+#if CONFIG_MAX_TILE
+ oxcf->tile_width_count = AOMMIN(cfg->tile_width_count, MAX_TILE_COLS);
+ oxcf->tile_height_count = AOMMIN(cfg->tile_height_count, MAX_TILE_ROWS);
+ for (int i = 0; i < oxcf->tile_width_count; i++) {
+ oxcf->tile_widths[i] = AOMMAX(cfg->tile_widths[i], 1);
+ }
+ for (int i = 0; i < oxcf->tile_height_count; i++) {
+ oxcf->tile_heights[i] = AOMMAX(cfg->tile_heights[i], 1);
+ }
+#endif
#if CONFIG_DEPENDENT_HORZTILES
oxcf->dependent_horz_tiles =
#if CONFIG_EXT_TILE
@@ -608,39 +660,7 @@ static aom_codec_err_t set_encoder_config(
#endif
oxcf->frame_periodic_boost = extra_cfg->frame_periodic_boost;
-
oxcf->motion_vector_unit_test = extra_cfg->motion_vector_unit_test;
- /*
- printf("Current AV1 Settings: \n");
- printf("target_bandwidth: %d\n", oxcf->target_bandwidth);
- printf("noise_sensitivity: %d\n", oxcf->noise_sensitivity);
- printf("sharpness: %d\n", oxcf->sharpness);
- printf("cpu_used: %d\n", oxcf->cpu_used);
- printf("Mode: %d\n", oxcf->mode);
- printf("auto_key: %d\n", oxcf->auto_key);
- printf("key_freq: %d\n", oxcf->key_freq);
- printf("end_usage: %d\n", oxcf->end_usage);
- printf("under_shoot_pct: %d\n", oxcf->under_shoot_pct);
- printf("over_shoot_pct: %d\n", oxcf->over_shoot_pct);
- printf("starting_buffer_level: %d\n", oxcf->starting_buffer_level);
- printf("optimal_buffer_level: %d\n", oxcf->optimal_buffer_level);
- printf("maximum_buffer_size: %d\n", oxcf->maximum_buffer_size);
- printf("fixed_q: %d\n", oxcf->fixed_q);
- printf("worst_allowed_q: %d\n", oxcf->worst_allowed_q);
- printf("best_allowed_q: %d\n", oxcf->best_allowed_q);
- printf("allow_spatial_resampling: %d\n", oxcf->allow_spatial_resampling);
- printf("scaled_frame_width: %d\n", oxcf->scaled_frame_width);
- printf("scaled_frame_height: %d\n", oxcf->scaled_frame_height);
- printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias);
- printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section);
- printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section);
- printf("lag_in_frames: %d\n", oxcf->lag_in_frames);
- printf("enable_auto_arf: %d\n", oxcf->enable_auto_arf);
- printf("Version: %d\n", oxcf->Version);
- printf("error resilient: %d\n", oxcf->error_resilient_mode);
- printf("frame parallel detokenization: %d\n",
- oxcf->frame_parallel_decoding_mode);
- */
return AOM_CODEC_OK;
}
@@ -764,6 +784,7 @@ static aom_codec_err_t ctrl_set_tile_rows(aom_codec_alg_priv_t *ctx,
extra_cfg.tile_rows = CAST(AV1E_SET_TILE_ROWS, args);
return update_extra_cfg(ctx, &extra_cfg);
}
+
#if CONFIG_DEPENDENT_HORZTILES
static aom_codec_err_t ctrl_set_tile_dependent_rows(aom_codec_alg_priv_t *ctx,
va_list args) {
@@ -862,7 +883,14 @@ static aom_codec_err_t ctrl_set_qm_max(aom_codec_alg_priv_t *ctx,
return update_extra_cfg(ctx, &extra_cfg);
}
#endif
-
+#if CONFIG_DIST_8X8
+static aom_codec_err_t ctrl_set_enable_dist_8x8(aom_codec_alg_priv_t *ctx,
+ va_list args) {
+ struct av1_extracfg extra_cfg = ctx->extra_cfg;
+ extra_cfg.enable_dist_8x8 = CAST(AV1E_SET_ENABLE_DIST_8X8, args);
+ return update_extra_cfg(ctx, &extra_cfg);
+}
+#endif
static aom_codec_err_t ctrl_set_num_tg(aom_codec_alg_priv_t *ctx,
va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
@@ -1044,7 +1072,7 @@ static int write_superframe_index(aom_codec_alg_priv_t *ctx) {
// Choose the magnitude
int mag;
unsigned int mask;
- for (mag = 0, mask = 0xff; mag < 4; mag++) {
+ for (mag = 0, mask = 0xff; mag < MAG_SIZE; mag++) {
if (max_frame_sz <= mask) break;
mask <<= 8;
mask |= 0xff;
@@ -1052,7 +1080,7 @@ static int write_superframe_index(aom_codec_alg_priv_t *ctx) {
marker |= mag << 3;
// Write the index
- uint8_t buffer[256];
+ uint8_t buffer[MAX_INDEX_SIZE];
uint8_t *x = buffer;
if (TEST_SUPPLEMENTAL_SUPERFRAME_DATA) {
@@ -1080,6 +1108,7 @@ static int write_superframe_index(aom_codec_alg_priv_t *ctx) {
*x++ = marker;
const size_t index_sz = x - buffer;
+ assert(index_sz < MAX_INDEX_SIZE);
assert(ctx->pending_cx_data_sz + index_sz < ctx->cx_data_sz);
// move the frame to make room for the index
@@ -1229,36 +1258,46 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
}
}
- size_t frame_size;
+ size_t frame_size = 0;
unsigned int lib_flags = 0;
- while (cx_data_sz >= ctx->cx_data_sz / 2 &&
+ int is_frame_visible = 0;
+ int index_size = 0;
+ // invisible frames get packed with the next visible frame
+ while (cx_data_sz - index_size >= ctx->cx_data_sz / 2 &&
+ !is_frame_visible &&
-1 != av1_get_compressed_data(cpi, &lib_flags, &frame_size, cx_data,
&dst_time_stamp, &dst_end_time_stamp,
!img)) {
#if CONFIG_REFERENCE_BUFFER
- if (cpi->common.invalid_delta_frame_id_minus1) {
- ctx->base.err_detail = "Invalid delta_frame_id_minus1";
- return AOM_CODEC_ERROR;
+ if (cpi->common.seq_params.frame_id_numbers_present_flag) {
+ if (cpi->common.invalid_delta_frame_id_minus1) {
+ ctx->base.err_detail = "Invalid delta_frame_id_minus1";
+ return AOM_CODEC_ERROR;
+ }
}
-#endif
- if (!frame_size) continue;
+#endif // CONFIG_REFERENCE_BUFFER
+ if (frame_size) {
+ if (ctx->pending_cx_data == 0) ctx->pending_cx_data = cx_data;
- if (ctx->pending_cx_data == 0) ctx->pending_cx_data = cx_data;
+ ctx->pending_frame_sizes[ctx->pending_frame_count++] = frame_size;
+ ctx->pending_cx_data_sz += frame_size;
- ctx->pending_frame_sizes[ctx->pending_frame_count++] = frame_size;
- ctx->pending_cx_data_sz += frame_size;
+ cx_data += frame_size;
+ cx_data_sz -= frame_size;
- cx_data += frame_size;
- cx_data_sz -= frame_size;
-
- // invisible frames get packed with the next visible frame
- if (!cpi->common.show_frame) continue;
+ index_size = MAG_SIZE * (ctx->pending_frame_count - 1) + 2;
+ is_frame_visible = cpi->common.show_frame;
+ }
+ }
+ if (is_frame_visible) {
// insert superframe index if needed
if (ctx->pending_frame_count > 1) {
- const size_t index_size = write_superframe_index(ctx);
- cx_data += index_size;
- cx_data_sz -= index_size;
+#if CONFIG_DEBUG
+ assert(index_size >= write_superframe_index(ctx));
+#else
+ write_superframe_index(ctx);
+#endif
}
// Add the frame packet to the list of returned packets.
@@ -1294,14 +1333,13 @@ static const aom_codec_cx_pkt_t *encoder_get_cxdata(aom_codec_alg_priv_t *ctx,
static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx,
va_list args) {
- aom_ref_frame_t *const frame = va_arg(args, aom_ref_frame_t *);
+ av1_ref_frame_t *const frame = va_arg(args, av1_ref_frame_t *);
if (frame != NULL) {
YV12_BUFFER_CONFIG sd;
image2yuvconfig(&frame->img, &sd);
- av1_set_reference_enc(ctx->cpi, ref_frame_to_av1_reframe(frame->frame_type),
- &sd);
+ av1_set_reference_enc(ctx->cpi, frame->idx, &sd);
return AOM_CODEC_OK;
} else {
return AOM_CODEC_INVALID_PARAM;
@@ -1310,14 +1348,13 @@ static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx,
static aom_codec_err_t ctrl_copy_reference(aom_codec_alg_priv_t *ctx,
va_list args) {
- aom_ref_frame_t *const frame = va_arg(args, aom_ref_frame_t *);
+ av1_ref_frame_t *const frame = va_arg(args, av1_ref_frame_t *);
if (frame != NULL) {
YV12_BUFFER_CONFIG sd;
image2yuvconfig(&frame->img, &sd);
- av1_copy_reference_enc(ctx->cpi,
- ref_frame_to_av1_reframe(frame->frame_type), &sd);
+ av1_copy_reference_enc(ctx->cpi, frame->idx, &sd);
return AOM_CODEC_OK;
} else {
return AOM_CODEC_INVALID_PARAM;
@@ -1450,22 +1487,32 @@ static aom_codec_err_t ctrl_set_color_space(aom_codec_alg_priv_t *ctx,
return update_extra_cfg(ctx, &extra_cfg);
}
-#if CONFIG_COLORSPACE_HEADERS
static aom_codec_err_t ctrl_set_transfer_function(aom_codec_alg_priv_t *ctx,
va_list args) {
+#if CONFIG_COLORSPACE_HEADERS
struct av1_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.transfer_function = CAST(AV1E_SET_TRANSFER_FUNCTION, args);
return update_extra_cfg(ctx, &extra_cfg);
+#else
+ (void)ctx;
+ (void)args;
+ return AOM_CODEC_UNSUP_FEATURE;
+#endif
}
static aom_codec_err_t ctrl_set_chroma_sample_position(
aom_codec_alg_priv_t *ctx, va_list args) {
+#if CONFIG_COLORSPACE_HEADERS
struct av1_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.chroma_sample_position =
CAST(AV1E_SET_CHROMA_SAMPLE_POSITION, args);
return update_extra_cfg(ctx, &extra_cfg);
-}
+#else
+ (void)ctx;
+ (void)args;
+ return AOM_CODEC_UNSUP_FEATURE;
#endif
+}
static aom_codec_err_t ctrl_set_color_range(aom_codec_alg_priv_t *ctx,
va_list args) {
@@ -1500,11 +1547,11 @@ static aom_codec_err_t ctrl_set_ans_window_size_log2(aom_codec_alg_priv_t *ctx,
#endif
static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
- { AOM_COPY_REFERENCE, ctrl_copy_reference },
+ { AV1_COPY_REFERENCE, ctrl_copy_reference },
{ AOME_USE_REFERENCE, ctrl_use_reference },
// Setters
- { AOM_SET_REFERENCE, ctrl_set_reference },
+ { AV1_SET_REFERENCE, ctrl_set_reference },
{ AOM_SET_POSTPROC, ctrl_set_previewpp },
{ AOME_SET_ROI_MAP, ctrl_set_roi_map },
{ AOME_SET_ACTIVEMAP, ctrl_set_active_map },
@@ -1537,6 +1584,9 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{ AV1E_SET_QM_MIN, ctrl_set_qm_min },
{ AV1E_SET_QM_MAX, ctrl_set_qm_max },
#endif
+#if CONFIG_DIST_8X8
+ { AV1E_SET_ENABLE_DIST_8X8, ctrl_set_enable_dist_8x8 },
+#endif
{ AV1E_SET_NUM_TG, ctrl_set_num_tg },
{ AV1E_SET_MTU, ctrl_set_mtu },
#if CONFIG_TEMPMV_SIGNALING
@@ -1550,10 +1600,8 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{ AV1E_SET_FRAME_PERIODIC_BOOST, ctrl_set_frame_periodic_boost },
{ AV1E_SET_TUNE_CONTENT, ctrl_set_tune_content },
{ AV1E_SET_COLOR_SPACE, ctrl_set_color_space },
-#if CONFIG_COLORSPACE_HEADERS
{ AV1E_SET_TRANSFER_FUNCTION, ctrl_set_transfer_function },
{ AV1E_SET_CHROMA_SAMPLE_POSITION, ctrl_set_chroma_sample_position },
-#endif
{ AV1E_SET_COLOR_RANGE, ctrl_set_color_range },
{ AV1E_SET_NOISE_SENSITIVITY, ctrl_set_noise_sensitivity },
{ AV1E_SET_MIN_GF_INTERVAL, ctrl_set_min_gf_interval },
@@ -1597,16 +1645,18 @@ static aom_codec_enc_cfg_map_t encoder_usage_cfg_map[] = {
AOM_RC_ONE_PASS, // g_pass
- 25, // g_lag_in_frames
+ 17, // g_lag_in_frames
- 0, // rc_dropframe_thresh
- RESIZE_NONE, // rc_resize_mode
- SCALE_DENOMINATOR, // rc_resize_numerator
- SCALE_DENOMINATOR, // rc_resize_kf_numerator
+ 0, // rc_dropframe_thresh
+ RESIZE_NONE, // rc_resize_mode
+ SCALE_NUMERATOR, // rc_resize_denominator
+ SCALE_NUMERATOR, // rc_resize_kf_denominator
- 0, // rc_superres_mode
- SCALE_DENOMINATOR, // rc_superres_numerator
- SCALE_DENOMINATOR, // rc_superres_kf_numerator
+ 0, // rc_superres_mode
+ SCALE_NUMERATOR, // rc_superres_denominator
+ SCALE_NUMERATOR, // rc_superres_kf_denominator
+ 63, // rc_superres_qthresh
+ 63, // rc_superres_kf_qthresh
AOM_VBR, // rc_end_usage
{ NULL, 0 }, // rc_twopass_stats_in
@@ -1630,6 +1680,10 @@ static aom_codec_enc_cfg_map_t encoder_usage_cfg_map[] = {
0, // kf_min_dist
9999, // kf_max_dist
0, // large_scale_tile
+ 0, // tile_width_count
+ 0, // tile_height_count
+ { 0 }, // tile_widths
+ { 0 }, // tile_heights
} },
};