summaryrefslogtreecommitdiffstats
path: root/third_party/aom/aomenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/aomenc.c')
-rw-r--r--third_party/aom/aomenc.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/third_party/aom/aomenc.c b/third_party/aom/aomenc.c
index f4bf888ce..ec1935aed 100644
--- a/third_party/aom/aomenc.c
+++ b/third_party/aom/aomenc.c
@@ -25,7 +25,7 @@
#endif
#include "aom/aom_encoder.h"
-#if CONFIG_DECODERS
+#if CONFIG_AV1_DECODER
#include "aom/aom_decoder.h"
#endif
@@ -45,6 +45,7 @@
#include "./rate_hist.h"
#include "./warnings.h"
#include "aom/aom_integer.h"
+#include "aom_dsp/aom_dsp_common.h"
#include "aom_ports/aom_timer.h"
#include "aom_ports/mem_ops.h"
#if CONFIG_WEBM_IO
@@ -627,7 +628,6 @@ void usage_exit(void) {
exit(EXIT_FAILURE);
}
-#define NELEMENTS(x) (sizeof(x) / sizeof(x[0]))
#if CONFIG_AV1_ENCODER
#define ARG_CTRL_CNT_MAX NELEMENTS(av1_arg_ctrl_map)
#endif
@@ -1061,15 +1061,8 @@ static int parse_stream_params(struct AvxEncoderConfig *global,
}
}
#if CONFIG_HIGHBITDEPTH
-#if CONFIG_LOWBITDEPTH
- if (strcmp(global->codec->name, "av1") == 0 ||
- strcmp(global->codec->name, "av1") == 0) {
- config->use_16bit_internal =
- test_16bit_internal | (config->cfg.g_profile > 1);
- }
-#else
- config->use_16bit_internal = 1;
-#endif
+ config->use_16bit_internal =
+ test_16bit_internal || (config->cfg.g_profile > 1) || !CONFIG_LOWBITDEPTH;
#endif
return eos_mark_found;
}
@@ -1344,13 +1337,13 @@ static void initialize_encoder(struct stream_state *stream,
ctx_exit_on_error(&stream->encoder, "Failed to control codec");
}
-#if CONFIG_DECODERS
+#if CONFIG_AV1_DECODER
if (global->test_decode != TEST_DECODE_OFF) {
const AvxInterface *decoder = get_aom_decoder_by_name(global->codec->name);
aom_codec_dec_cfg_t cfg = { 0, 0, 0 };
aom_codec_dec_init(&stream->decoder, decoder->codec_interface(), &cfg, 0);
-#if CONFIG_AV1_DECODER && CONFIG_EXT_TILE
+#if CONFIG_EXT_TILE
if (strcmp(global->codec->name, "av1") == 0) {
aom_codec_control(&stream->decoder, AV1_SET_DECODE_TILE_ROW, -1);
ctx_exit_on_error(&stream->decoder, "Failed to set decode_tile_row");
@@ -1510,7 +1503,7 @@ static void get_cx_data(struct stream_state *stream,
stream->nbytes += pkt->data.raw.sz;
*got_data = 1;
-#if CONFIG_DECODERS
+#if CONFIG_AV1_DECODER
if (global->test_decode != TEST_DECODE_OFF && !stream->mismatch_seen) {
aom_codec_decode(&stream->decoder, pkt->data.frame.buf,
(unsigned int)pkt->data.frame.sz, NULL, 0);