Commit 47cc2559 authored by Sean DuBois's avatar Sean DuBois
Browse files

Remove deadline

BUG=aomedia:13

Change-Id: I9df343f4a6a809b09446ff1f2083c38771ab068b
parent 913867b4
...@@ -203,8 +203,6 @@ aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx, ...@@ -203,8 +203,6 @@ aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx,
* \param[in] data_sz Size of the coded data, in bytes. * \param[in] data_sz Size of the coded data, in bytes.
* \param[in] user_priv Application specific data to associate with * \param[in] user_priv Application specific data to associate with
* this frame. * this frame.
* \param[in] deadline Soft deadline the decoder should attempt to meet,
* in us. Set to zero for unlimited.
* *
* \return Returns #AOM_CODEC_OK if the coded data was processed completely * \return Returns #AOM_CODEC_OK if the coded data was processed completely
* and future pictures can be decoded without error. Otherwise, * and future pictures can be decoded without error. Otherwise,
...@@ -212,8 +210,7 @@ aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx, ...@@ -212,8 +210,7 @@ aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx,
* for recoverability capabilities. * for recoverability capabilities.
*/ */
aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data, aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
unsigned int data_sz, void *user_priv, unsigned int data_sz, void *user_priv);
long deadline);
/*!\brief Decoded frames iterator /*!\brief Decoded frames iterator
* *
......
...@@ -789,23 +789,11 @@ aom_codec_err_t aom_codec_enc_config_set(aom_codec_ctx_t *ctx, ...@@ -789,23 +789,11 @@ aom_codec_err_t aom_codec_enc_config_set(aom_codec_ctx_t *ctx,
*/ */
aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx); aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);
/*!\brief deadline parameter analogous to AVx GOOD QUALITY mode. */
#define AOM_DL_GOOD_QUALITY (1000000)
/*!\brief Encode a frame /*!\brief Encode a frame
* *
* Encodes a video frame at the given "presentation time." The presentation * Encodes a video frame at the given "presentation time." The presentation
* time stamp (PTS) \ref MUST be strictly increasing. * time stamp (PTS) \ref MUST be strictly increasing.
* *
* The encoder supports the notion of a soft real-time deadline. Given a
* non-zero value to the deadline parameter, the encoder will make a "best
* effort" guarantee to return before the given time slice expires. It is
* implicit that limiting the available time to encode will degrade the
* output quality. The encoder can be given an unlimited time to produce the
* best possible frame by specifying a deadline of '0'. This deadline
* supercedes the AVx notion of "best quality, good quality, realtime".
* Applications that wish to map these former settings to the new deadline
* based system can use the symbol #AOM_DL_GOOD_QUALITY.
*
* When the last frame has been passed to the encoder, this function should * When the last frame has been passed to the encoder, this function should
* continue to be called, with the img parameter set to NULL. This will * continue to be called, with the img parameter set to NULL. This will
* signal the end-of-stream condition to the encoder and allow it to encode * signal the end-of-stream condition to the encoder and allow it to encode
...@@ -817,7 +805,6 @@ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx); ...@@ -817,7 +805,6 @@ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);
* \param[in] pts Presentation time stamp, in timebase units. * \param[in] pts Presentation time stamp, in timebase units.
* \param[in] duration Duration to show frame, in timebase units. * \param[in] duration Duration to show frame, in timebase units.
* \param[in] flags Flags to use for encoding this frame. * \param[in] flags Flags to use for encoding this frame.
* \param[in] deadline Time to spend encoding, in microseconds. (0=infinite)
* *
* \retval #AOM_CODEC_OK * \retval #AOM_CODEC_OK
* The configuration was populated. * The configuration was populated.
...@@ -828,8 +815,7 @@ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx); ...@@ -828,8 +815,7 @@ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);
*/ */
aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img, aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned long duration, aom_codec_pts_t pts, unsigned long duration,
aom_enc_frame_flags_t flags, aom_enc_frame_flags_t flags);
unsigned long deadline);
/*!\brief Set compressed data output buffer /*!\brief Set compressed data output buffer
* *
......
...@@ -196,8 +196,7 @@ typedef const struct aom_codec_ctrl_fn_map { ...@@ -196,8 +196,7 @@ typedef const struct aom_codec_ctrl_fn_map {
typedef aom_codec_err_t (*aom_codec_decode_fn_t)(aom_codec_alg_priv_t *ctx, typedef aom_codec_err_t (*aom_codec_decode_fn_t)(aom_codec_alg_priv_t *ctx,
const uint8_t *data, const uint8_t *data,
unsigned int data_sz, unsigned int data_sz,
void *user_priv, void *user_priv);
long deadline);
/*!\brief Decoded frames iterator /*!\brief Decoded frames iterator
* *
...@@ -252,8 +251,7 @@ typedef aom_codec_err_t (*aom_codec_encode_fn_t)(aom_codec_alg_priv_t *ctx, ...@@ -252,8 +251,7 @@ typedef aom_codec_err_t (*aom_codec_encode_fn_t)(aom_codec_alg_priv_t *ctx,
const aom_image_t *img, const aom_image_t *img,
aom_codec_pts_t pts, aom_codec_pts_t pts,
unsigned long duration, unsigned long duration,
aom_enc_frame_flags_t flags, aom_enc_frame_flags_t flags);
unsigned long deadline);
typedef const aom_codec_cx_pkt_t *(*aom_codec_get_cx_data_fn_t)( typedef const aom_codec_cx_pkt_t *(*aom_codec_get_cx_data_fn_t)(
aom_codec_alg_priv_t *ctx, aom_codec_iter_t *iter); aom_codec_alg_priv_t *ctx, aom_codec_iter_t *iter);
......
...@@ -99,8 +99,7 @@ aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx, ...@@ -99,8 +99,7 @@ aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx,
} }
aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data, aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
unsigned int data_sz, void *user_priv, unsigned int data_sz, void *user_priv) {
long deadline) {
aom_codec_err_t res; aom_codec_err_t res;
/* Sanity checks */ /* Sanity checks */
...@@ -110,8 +109,7 @@ aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data, ...@@ -110,8 +109,7 @@ aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
else if (!ctx->iface || !ctx->priv) else if (!ctx->iface || !ctx->priv)
res = AOM_CODEC_ERROR; res = AOM_CODEC_ERROR;
else { else {
res = ctx->iface->dec.decode(get_alg_priv(ctx), data, data_sz, user_priv, res = ctx->iface->dec.decode(get_alg_priv(ctx), data, data_sz, user_priv);
deadline);
} }
return SAVE_STATUS(ctx, res); return SAVE_STATUS(ctx, res);
......
...@@ -213,8 +213,7 @@ aom_codec_err_t aom_codec_enc_config_default(aom_codec_iface_t *iface, ...@@ -213,8 +213,7 @@ aom_codec_err_t aom_codec_enc_config_default(aom_codec_iface_t *iface,
aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img, aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned long duration, aom_codec_pts_t pts, unsigned long duration,
aom_enc_frame_flags_t flags, aom_enc_frame_flags_t flags) {
unsigned long deadline) {
aom_codec_err_t res = AOM_CODEC_OK; aom_codec_err_t res = AOM_CODEC_OK;
if (!ctx || (img && !duration)) if (!ctx || (img && !duration))
...@@ -232,8 +231,8 @@ aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img, ...@@ -232,8 +231,8 @@ aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img,
FLOATING_POINT_INIT FLOATING_POINT_INIT
if (num_enc == 1) if (num_enc == 1)
res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration, flags, res =
deadline); ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration, flags);
else { else {
/* Multi-resolution encoding: /* Multi-resolution encoding:
* Encode multi-levels in reverse order. For example, * Encode multi-levels in reverse order. For example,
...@@ -247,7 +246,7 @@ aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img, ...@@ -247,7 +246,7 @@ aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img,
for (i = num_enc - 1; i >= 0; i--) { for (i = num_enc - 1; i >= 0; i--) {
if ((res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration, if ((res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration,
flags, deadline))) flags)))
break; break;
ctx--; ctx--;
......
...@@ -790,8 +790,8 @@ static int main_loop(int argc, const char **argv_) { ...@@ -790,8 +790,8 @@ static int main_loop(int argc, const char **argv_) {
aom_usec_timer_start(&timer); aom_usec_timer_start(&timer);
if (aom_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer, NULL, if (aom_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer,
0)) { NULL)) {
const char *detail = aom_codec_error_detail(&decoder); const char *detail = aom_codec_error_detail(&decoder);
warn("Failed to decode frame %d: %s", frame_in, warn("Failed to decode frame %d: %s", frame_in,
aom_codec_error(&decoder)); aom_codec_error(&decoder));
...@@ -823,7 +823,7 @@ static int main_loop(int argc, const char **argv_) { ...@@ -823,7 +823,7 @@ static int main_loop(int argc, const char **argv_) {
if (flush_decoder) { if (flush_decoder) {
// Flush the decoder in frame parallel decode. // Flush the decoder in frame parallel decode.
if (aom_codec_decode(&decoder, NULL, 0, NULL, 0)) { if (aom_codec_decode(&decoder, NULL, 0, NULL)) {
warn("Failed to flush decoder: %s", aom_codec_error(&decoder)); warn("Failed to flush decoder: %s", aom_codec_error(&decoder));
} }
} }
......
...@@ -157,10 +157,6 @@ static const arg_def_t limit = ...@@ -157,10 +157,6 @@ static const arg_def_t limit =
ARG_DEF(NULL, "limit", 1, "Stop encoding after n input frames"); ARG_DEF(NULL, "limit", 1, "Stop encoding after n input frames");
static const arg_def_t skip = static const arg_def_t skip =
ARG_DEF(NULL, "skip", 1, "Skip the first n input frames"); ARG_DEF(NULL, "skip", 1, "Skip the first n input frames");
static const arg_def_t deadline =
ARG_DEF("d", "deadline", 1, "Deadline per frame (usec)");
static const arg_def_t good_dl =
ARG_DEF(NULL, "good", 0, "Use Good Quality Deadline");
static const arg_def_t quietarg = static const arg_def_t quietarg =
ARG_DEF("q", "quiet", 0, "Do not print encode progress"); ARG_DEF("q", "quiet", 0, "Do not print encode progress");
static const arg_def_t verbosearg = static const arg_def_t verbosearg =
...@@ -216,8 +212,6 @@ static const arg_def_t *main_args[] = { &help, ...@@ -216,8 +212,6 @@ static const arg_def_t *main_args[] = { &help,
&fpf_name, &fpf_name,
&limit, &limit,
&skip, &skip,
&deadline,
&good_dl,
&quietarg, &quietarg,
&verbosearg, &verbosearg,
&psnrarg, &psnrarg,
...@@ -902,8 +896,6 @@ static void parse_global_config(struct AvxEncoderConfig *global, char **argv) { ...@@ -902,8 +896,6 @@ static void parse_global_config(struct AvxEncoderConfig *global, char **argv) {
global->codec = get_aom_encoder_by_index(num_encoder - 1); global->codec = get_aom_encoder_by_index(num_encoder - 1);
global->passes = 0; global->passes = 0;
global->color_type = I420; global->color_type = I420;
/* Assign default deadline to good quality */
global->deadline = AOM_DL_GOOD_QUALITY;
for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) {
arg.argv_step = 1; arg.argv_step = 1;
...@@ -927,10 +919,6 @@ static void parse_global_config(struct AvxEncoderConfig *global, char **argv) { ...@@ -927,10 +919,6 @@ static void parse_global_config(struct AvxEncoderConfig *global, char **argv) {
die("Error: Invalid pass selected (%d)\n", global->pass); die("Error: Invalid pass selected (%d)\n", global->pass);
} else if (arg_match(&arg, &usage, argi)) } else if (arg_match(&arg, &usage, argi))
global->usage = arg_parse_uint(&arg); global->usage = arg_parse_uint(&arg);
else if (arg_match(&arg, &deadline, argi))
global->deadline = arg_parse_uint(&arg);
else if (arg_match(&arg, &good_dl, argi))
global->deadline = AOM_DL_GOOD_QUALITY;
else if (arg_match(&arg, &use_yv12, argi)) else if (arg_match(&arg, &use_yv12, argi))
global->color_type = YV12; global->color_type = YV12;
else if (arg_match(&arg, &use_i420, argi)) else if (arg_match(&arg, &use_i420, argi))
...@@ -1694,8 +1682,7 @@ static void encode_frame(struct stream_state *stream, ...@@ -1694,8 +1682,7 @@ static void encode_frame(struct stream_state *stream,
aom_usec_timer_start(&timer); aom_usec_timer_start(&timer);
aom_codec_encode(&stream->encoder, img, frame_start, aom_codec_encode(&stream->encoder, img, frame_start,
(unsigned long)(next_frame_start - frame_start), 0, (uint32_t)(next_frame_start - frame_start), 0);
global->deadline);
aom_usec_timer_mark(&timer); aom_usec_timer_mark(&timer);
stream->cx_time += aom_usec_timer_elapsed(&timer); stream->cx_time += aom_usec_timer_elapsed(&timer);
ctx_exit_on_error(&stream->encoder, "Stream %d: Failed to encode frame", ctx_exit_on_error(&stream->encoder, "Stream %d: Failed to encode frame",
...@@ -1769,7 +1756,7 @@ static void get_cx_data(struct stream_state *stream, ...@@ -1769,7 +1756,7 @@ static void get_cx_data(struct stream_state *stream,
#if CONFIG_AV1_DECODER #if CONFIG_AV1_DECODER
if (global->test_decode != TEST_DECODE_OFF && !stream->mismatch_seen) { if (global->test_decode != TEST_DECODE_OFF && !stream->mismatch_seen) {
aom_codec_decode(&stream->decoder, pkt->data.frame.buf, aom_codec_decode(&stream->decoder, pkt->data.frame.buf,
(unsigned int)pkt->data.frame.sz, NULL, 0); (unsigned int)pkt->data.frame.sz, NULL);
if (stream->decoder.err) { if (stream->decoder.err) {
warn_or_exit_on_error(&stream->decoder, warn_or_exit_on_error(&stream->decoder,
global->test_decode == TEST_DECODE_FATAL, global->test_decode == TEST_DECODE_FATAL,
......
...@@ -39,7 +39,6 @@ struct AvxEncoderConfig { ...@@ -39,7 +39,6 @@ struct AvxEncoderConfig {
int passes; int passes;
int pass; int pass;
int usage; int usage;
int deadline;
ColorInputType color_type; ColorInputType color_type;
int quiet; int quiet;
int verbose; int verbose;
......
...@@ -1110,26 +1110,6 @@ static aom_codec_err_t encoder_destroy(aom_codec_alg_priv_t *ctx) { ...@@ -1110,26 +1110,6 @@ static aom_codec_err_t encoder_destroy(aom_codec_alg_priv_t *ctx) {
return AOM_CODEC_OK; return AOM_CODEC_OK;
} }
static void pick_quickcompress_mode(aom_codec_alg_priv_t *ctx,
unsigned long deadline) {
MODE new_mode = GOOD;
switch (ctx->cfg.g_pass) {
case AOM_RC_ONE_PASS:
switch (deadline) {
default: new_mode = GOOD; break;
}
break;
case AOM_RC_FIRST_PASS: break;
case AOM_RC_LAST_PASS: new_mode = GOOD;
}
if (ctx->oxcf.mode != new_mode) {
ctx->oxcf.mode = new_mode;
av1_change_config(ctx->cpi, &ctx->oxcf);
}
}
// Turn on to test if supplemental superframe data breaks decoding // Turn on to test if supplemental superframe data breaks decoding
#define TEST_SUPPLEMENTAL_SUPERFRAME_DATA 0 #define TEST_SUPPLEMENTAL_SUPERFRAME_DATA 0
...@@ -1233,8 +1213,7 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx, ...@@ -1233,8 +1213,7 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
const aom_image_t *img, const aom_image_t *img,
aom_codec_pts_t pts, aom_codec_pts_t pts,
unsigned long duration, unsigned long duration,
aom_enc_frame_flags_t enc_flags, aom_enc_frame_flags_t enc_flags) {
unsigned long deadline) {
const size_t kMinCompressedSize = 8192; const size_t kMinCompressedSize = 8192;
volatile aom_codec_err_t res = AOM_CODEC_OK; volatile aom_codec_err_t res = AOM_CODEC_OK;
AV1_COMP *const cpi = ctx->cpi; AV1_COMP *const cpi = ctx->cpi;
...@@ -1261,7 +1240,11 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx, ...@@ -1261,7 +1240,11 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
} }
} }
pick_quickcompress_mode(ctx, deadline); if (ctx->oxcf.mode != GOOD) {
ctx->oxcf.mode = GOOD;
av1_change_config(ctx->cpi, &ctx->oxcf);
}
aom_codec_pkt_list_init(&ctx->pkt_list); aom_codec_pkt_list_init(&ctx->pkt_list);
volatile aom_enc_frame_flags_t flags = enc_flags; volatile aom_enc_frame_flags_t flags = enc_flags;
......
...@@ -594,9 +594,8 @@ static INLINE void check_resync(aom_codec_alg_priv_t *const ctx, ...@@ -594,9 +594,8 @@ static INLINE void check_resync(aom_codec_alg_priv_t *const ctx,
static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx, static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx,
const uint8_t **data, unsigned int data_sz, const uint8_t **data, unsigned int data_sz,
void *user_priv, int64_t deadline) { void *user_priv) {
const AVxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
(void)deadline;
// Determine the stream parameters. Note that we rely on peek_si to // Determine the stream parameters. Note that we rely on peek_si to
// validate that we have a buffer that does not wrap around the top // validate that we have a buffer that does not wrap around the top
...@@ -708,7 +707,7 @@ static void wait_worker_and_cache_frame(aom_codec_alg_priv_t *ctx) { ...@@ -708,7 +707,7 @@ static void wait_worker_and_cache_frame(aom_codec_alg_priv_t *ctx) {
static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx, static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx,
const uint8_t *data, unsigned int data_sz, const uint8_t *data, unsigned int data_sz,
void *user_priv, long deadline) { void *user_priv) {
const uint8_t *data_start = data; const uint8_t *data_start = data;
const uint8_t *const data_end = data + data_sz; const uint8_t *const data_end = data + data_sz;
aom_codec_err_t res = AOM_CODEC_OK; aom_codec_err_t res = AOM_CODEC_OK;
...@@ -765,8 +764,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx, ...@@ -765,8 +764,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx,
} }
} }
res = res = decode_one(ctx, &data_start_copy, frame_size, user_priv);
decode_one(ctx, &data_start_copy, frame_size, user_priv, deadline);
if (res != AOM_CODEC_OK) return res; if (res != AOM_CODEC_OK) return res;
data_start += frame_size; data_start += frame_size;
} }
...@@ -783,7 +781,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx, ...@@ -783,7 +781,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx,
} }
} }
res = decode_one(ctx, &data, data_sz, user_priv, deadline); res = decode_one(ctx, &data, data_sz, user_priv);
if (res != AOM_CODEC_OK) return res; if (res != AOM_CODEC_OK) return res;
} }
} else { } else {
...@@ -800,8 +798,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx, ...@@ -800,8 +798,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx,
return AOM_CODEC_CORRUPT_FRAME; return AOM_CODEC_CORRUPT_FRAME;
} }
res = res = decode_one(ctx, &data_start_copy, frame_size, user_priv);
decode_one(ctx, &data_start_copy, frame_size, user_priv, deadline);
if (res != AOM_CODEC_OK) return res; if (res != AOM_CODEC_OK) return res;
data_start += frame_size; data_start += frame_size;
...@@ -809,7 +806,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx, ...@@ -809,7 +806,7 @@ static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx,
} else { } else {
while (data_start < data_end) { while (data_start < data_end) {
const uint32_t frame_size = (uint32_t)(data_end - data_start); const uint32_t frame_size = (uint32_t)(data_end - data_start);
res = decode_one(ctx, &data_start, frame_size, user_priv, deadline); res = decode_one(ctx, &data_start, frame_size, user_priv);
if (res != AOM_CODEC_OK) return res; if (res != AOM_CODEC_OK) return res;
// Account for suboptimal termination by the encoder. // Account for suboptimal termination by the encoder.
......
...@@ -108,7 +108,7 @@ bool AV1Decoder::step() { ...@@ -108,7 +108,7 @@ bool AV1Decoder::step() {
size_t frame_size; size_t frame_size;
const unsigned char *frame_data; const unsigned char *frame_data;
frame_data = aom_video_reader_get_frame(reader, &frame_size); frame_data = aom_video_reader_get_frame(reader, &frame_size);
if (aom_codec_decode(&codec, frame_data, frame_size, NULL, 0)) { if (aom_codec_decode(&codec, frame_data, frame_size, NULL)) {
fprintf(stderr, "Failed to decode frame."); fprintf(stderr, "Failed to decode frame.");
return false; return false;
} else { } else {
......
...@@ -111,8 +111,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img, ...@@ -111,8 +111,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img,
aom_codec_iter_t iter = NULL; aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL; const aom_codec_cx_pkt_t *pkt = NULL;
int got_data; int got_data;
const aom_codec_err_t res = const aom_codec_err_t res = aom_codec_encode(ecodec, img, frame_in, 1, 0);
aom_codec_encode(ecodec, img, frame_in, 1, 0, AOM_DL_GOOD_QUALITY);
if (res != AOM_CODEC_OK) die_codec(ecodec, "Failed to encode frame"); if (res != AOM_CODEC_OK) die_codec(ecodec, "Failed to encode frame");
got_data = 0; got_data = 0;
...@@ -139,7 +138,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img, ...@@ -139,7 +138,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img,
// Decode 1 frame. // Decode 1 frame.
if (test_decode) { if (test_decode) {
if (aom_codec_decode(dcodec, pkt->data.frame.buf, if (aom_codec_decode(dcodec, pkt->data.frame.buf,
(unsigned int)pkt->data.frame.sz, NULL, 0)) (unsigned int)pkt->data.frame.sz, NULL))
die_codec(dcodec, "Failed to decode frame."); die_codec(dcodec, "Failed to decode frame.");
} }
} }
......
...@@ -110,7 +110,7 @@ int main(int argc, char **argv) { ...@@ -110,7 +110,7 @@ int main(int argc, char **argv) {
size_t frame_size = 0; size_t frame_size = 0;
const unsigned char *frame = const unsigned char *frame =
aom_video_reader_get_frame(reader, &frame_size); aom_video_reader_get_frame(reader, &frame_size);
if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL))
die_codec(&codec, "Failed to decode frame"); die_codec(&codec, "Failed to decode frame");
while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) { while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) {
......
...@@ -116,7 +116,7 @@ int main(int argc, char **argv) { ...@@ -116,7 +116,7 @@ int main(int argc, char **argv) {
int skip; int skip;
const unsigned char *frame = const unsigned char *frame =
aom_video_reader_get_frame(reader, &frame_size); aom_video_reader_get_frame(reader, &frame_size);
if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL))
die_codec(&codec, "Failed to decode frame."); die_codec(&codec, "Failed to decode frame.");
++frame_cnt; ++frame_cnt;
......
...@@ -663,7 +663,7 @@ int read_frame() { ...@@ -663,7 +663,7 @@ int read_frame() {
aom_codec_iter_t iter = NULL; aom_codec_iter_t iter = NULL;
size_t frame_size = 0; size_t frame_size = 0;
const unsigned char *frame = aom_video_reader_get_frame(reader, &frame_size); const unsigned char *frame = aom_video_reader_get_frame(reader, &frame_size);
if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0) != if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL) !=
AOM_CODEC_OK) { AOM_CODEC_OK) {
die_codec(&codec, "Failed to decode frame."); die_codec(&codec, "Failed to decode frame.");
} }
......
...@@ -137,7 +137,7 @@ int main(int argc, char **argv) { ...@@ -137,7 +137,7 @@ int main(int argc, char **argv) {
size_t frame_size = 0; size_t frame_size = 0;
const unsigned char *frame = const unsigned char *frame =
aom_video_reader_get_frame(reader, &frame_size); aom_video_reader_get_frame(reader, &frame_size);
if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) if (aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL))
die_codec(&codec, "Failed to decode frame."); die_codec(&codec, "Failed to decode frame.");
while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) { while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) {
...@@ -176,7 +176,7 @@ int main(int argc, char **argv) { ...@@ -176,7 +176,7 @@ int main(int argc, char **argv) {
aom_codec_control_(&codec, AV1_SET_DECODE_TILE_ROW, tile_t); aom_codec_control_(&codec, AV1_SET_DECODE_TILE_ROW, tile_t);
aom_codec_control_(&codec, AV1_SET_DECODE_TILE_COL, tile_s); aom_codec_control_(&codec, AV1_SET_DECODE_TILE_COL, tile_s);
aom_codec_err_t aom_status = aom_codec_err_t aom_status =
aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0); aom_codec_decode(&codec, frame, (unsigned int)frame_size, NULL);
if (aom_status) die_codec(&codec, "Failed to decode tile."); if (aom_status) die_codec(&codec, "Failed to decode tile.");
aom_codec_iter_t iter = NULL; aom_codec_iter_t iter = NULL;
aom_image_t *img = aom_codec_get_frame(&codec, &iter); aom_image_t *img = aom_codec_get_frame(&codec, &iter);
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "../video_writer.h" #include "../video_writer.h"
static const char *exec_name; static const char *exec_name;
static const unsigned int deadline = AOM_DL_GOOD_QUALITY;
void usage_exit(void) { void usage_exit(void) {
fprintf(stderr, fprintf(stderr,
...@@ -92,13 +91,12 @@ static int aom_img_size_bytes(aom_image_t *img) { ...@@ -92,13 +91,12 @@ static int aom_img_size_bytes(aom_image_t *img) {