Remove deadline
BUG=aomedia:13
Change-Id: I9df343f4a6a809b09446ff1f2083c38771ab068b
diff --git a/aom/aom_decoder.h b/aom/aom_decoder.h
index ceab934..9525283 100644
--- a/aom/aom_decoder.h
+++ b/aom/aom_decoder.h
@@ -203,8 +203,6 @@
* \param[in] data_sz Size of the coded data, in bytes.
* \param[in] user_priv Application specific data to associate with
* 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
* and future pictures can be decoded without error. Otherwise,
@@ -212,8 +210,7 @@
* for recoverability capabilities.
*/
aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
- unsigned int data_sz, void *user_priv,
- long deadline);
+ unsigned int data_sz, void *user_priv);
/*!\brief Decoded frames iterator
*
diff --git a/aom/aom_encoder.h b/aom/aom_encoder.h
index 7a7f4e4..516d797 100644
--- a/aom/aom_encoder.h
+++ b/aom/aom_encoder.h
@@ -789,23 +789,11 @@
*/
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
*
* Encodes a video frame at the given "presentation time." The presentation
* 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
* 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
@@ -817,7 +805,6 @@
* \param[in] pts Presentation time stamp, 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] deadline Time to spend encoding, in microseconds. (0=infinite)
*
* \retval #AOM_CODEC_OK
* The configuration was populated.
@@ -828,8 +815,7 @@
*/
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_enc_frame_flags_t flags,
- unsigned long deadline);
+ aom_enc_frame_flags_t flags);
/*!\brief Set compressed data output buffer
*
diff --git a/aom/internal/aom_codec_internal.h b/aom/internal/aom_codec_internal.h
index 5aacef7..a633d4c 100644
--- a/aom/internal/aom_codec_internal.h
+++ b/aom/internal/aom_codec_internal.h
@@ -196,8 +196,7 @@
typedef aom_codec_err_t (*aom_codec_decode_fn_t)(aom_codec_alg_priv_t *ctx,
const uint8_t *data,
unsigned int data_sz,
- void *user_priv,
- long deadline);
+ void *user_priv);
/*!\brief Decoded frames iterator
*
@@ -252,8 +251,7 @@
const aom_image_t *img,
aom_codec_pts_t pts,
unsigned long duration,
- aom_enc_frame_flags_t flags,
- unsigned long deadline);
+ aom_enc_frame_flags_t flags);
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);
diff --git a/aom/src/aom_decoder.c b/aom/src/aom_decoder.c
index 75eb810..ecbf838 100644
--- a/aom/src/aom_decoder.c
+++ b/aom/src/aom_decoder.c
@@ -99,8 +99,7 @@
}
aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
- unsigned int data_sz, void *user_priv,
- long deadline) {
+ unsigned int data_sz, void *user_priv) {
aom_codec_err_t res;
/* Sanity checks */
@@ -110,8 +109,7 @@
else if (!ctx->iface || !ctx->priv)
res = AOM_CODEC_ERROR;
else {
- res = ctx->iface->dec.decode(get_alg_priv(ctx), data, data_sz, user_priv,
- deadline);
+ res = ctx->iface->dec.decode(get_alg_priv(ctx), data, data_sz, user_priv);
}
return SAVE_STATUS(ctx, res);
diff --git a/aom/src/aom_encoder.c b/aom/src/aom_encoder.c
index ac84c88..c5abb9f 100644
--- a/aom/src/aom_encoder.c
+++ b/aom/src/aom_encoder.c
@@ -213,8 +213,7 @@
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_enc_frame_flags_t flags,
- unsigned long deadline) {
+ aom_enc_frame_flags_t flags) {
aom_codec_err_t res = AOM_CODEC_OK;
if (!ctx || (img && !duration))
@@ -232,8 +231,8 @@
FLOATING_POINT_INIT
if (num_enc == 1)
- res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration, flags,
- deadline);
+ res =
+ ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration, flags);
else {
/* Multi-resolution encoding:
* Encode multi-levels in reverse order. For example,
@@ -247,7 +246,7 @@
for (i = num_enc - 1; i >= 0; i--) {
if ((res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration,
- flags, deadline)))
+ flags)))
break;
ctx--;
diff --git a/aomdec.c b/aomdec.c
index 0724ee1..097d6fe 100644
--- a/aomdec.c
+++ b/aomdec.c
@@ -790,8 +790,8 @@
aom_usec_timer_start(&timer);
- if (aom_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer, NULL,
- 0)) {
+ if (aom_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer,
+ NULL)) {
const char *detail = aom_codec_error_detail(&decoder);
warn("Failed to decode frame %d: %s", frame_in,
aom_codec_error(&decoder));
@@ -823,7 +823,7 @@
if (flush_decoder) {
// 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));
}
}
diff --git a/aomenc.c b/aomenc.c
index e72bdee..33d7199 100644
--- a/aomenc.c
+++ b/aomenc.c
@@ -157,10 +157,6 @@
ARG_DEF(NULL, "limit", 1, "Stop encoding after n input frames");
static const arg_def_t skip =
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 =
ARG_DEF("q", "quiet", 0, "Do not print encode progress");
static const arg_def_t verbosearg =
@@ -216,8 +212,6 @@
&fpf_name,
&limit,
&skip,
- &deadline,
- &good_dl,
&quietarg,
&verbosearg,
&psnrarg,
@@ -902,8 +896,6 @@
global->codec = get_aom_encoder_by_index(num_encoder - 1);
global->passes = 0;
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) {
arg.argv_step = 1;
@@ -927,10 +919,6 @@
die("Error: Invalid pass selected (%d)\n", global->pass);
} else if (arg_match(&arg, &usage, argi))
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))
global->color_type = YV12;
else if (arg_match(&arg, &use_i420, argi))
@@ -1694,8 +1682,7 @@
aom_usec_timer_start(&timer);
aom_codec_encode(&stream->encoder, img, frame_start,
- (unsigned long)(next_frame_start - frame_start), 0,
- global->deadline);
+ (uint32_t)(next_frame_start - frame_start), 0);
aom_usec_timer_mark(&timer);
stream->cx_time += aom_usec_timer_elapsed(&timer);
ctx_exit_on_error(&stream->encoder, "Stream %d: Failed to encode frame",
@@ -1769,7 +1756,7 @@
#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);
+ (unsigned int)pkt->data.frame.sz, NULL);
if (stream->decoder.err) {
warn_or_exit_on_error(&stream->decoder,
global->test_decode == TEST_DECODE_FATAL,
diff --git a/aomenc.h b/aomenc.h
index 248e583..1bb98e3 100644
--- a/aomenc.h
+++ b/aomenc.h
@@ -39,7 +39,6 @@
int passes;
int pass;
int usage;
- int deadline;
ColorInputType color_type;
int quiet;
int verbose;
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 07178de..8af3c14 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -1110,26 +1110,6 @@
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
#define TEST_SUPPLEMENTAL_SUPERFRAME_DATA 0
@@ -1233,8 +1213,7 @@
const aom_image_t *img,
aom_codec_pts_t pts,
unsigned long duration,
- aom_enc_frame_flags_t enc_flags,
- unsigned long deadline) {
+ aom_enc_frame_flags_t enc_flags) {
const size_t kMinCompressedSize = 8192;
volatile aom_codec_err_t res = AOM_CODEC_OK;
AV1_COMP *const cpi = ctx->cpi;
@@ -1261,7 +1240,11 @@
}
}
- 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);
volatile aom_enc_frame_flags_t flags = enc_flags;
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c
index ccc7851..35c2da3 100644
--- a/av1/av1_dx_iface.c
+++ b/av1/av1_dx_iface.c
@@ -594,9 +594,8 @@
static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx,
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();
- (void)deadline;
// 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
@@ -708,7 +707,7 @@
static aom_codec_err_t decoder_decode(aom_codec_alg_priv_t *ctx,
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 *const data_end = data + data_sz;
aom_codec_err_t res = AOM_CODEC_OK;
@@ -765,8 +764,7 @@
}
}
- res =
- decode_one(ctx, &data_start_copy, frame_size, user_priv, deadline);
+ res = decode_one(ctx, &data_start_copy, frame_size, user_priv);
if (res != AOM_CODEC_OK) return res;
data_start += frame_size;
}
@@ -783,7 +781,7 @@
}
}
- 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;
}
} else {
@@ -800,8 +798,7 @@
return AOM_CODEC_CORRUPT_FRAME;
}
- res =
- decode_one(ctx, &data_start_copy, frame_size, user_priv, deadline);
+ res = decode_one(ctx, &data_start_copy, frame_size, user_priv);
if (res != AOM_CODEC_OK) return res;
data_start += frame_size;
@@ -809,7 +806,7 @@
} else {
while (data_start < data_end) {
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;
// Account for suboptimal termination by the encoder.
diff --git a/examples/analyzer.cc b/examples/analyzer.cc
index 1c50325..a5e35cf 100644
--- a/examples/analyzer.cc
+++ b/examples/analyzer.cc
@@ -108,7 +108,7 @@
size_t frame_size;
const unsigned char *frame_data;
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.");
return false;
} else {
diff --git a/examples/aom_cx_set_ref.c b/examples/aom_cx_set_ref.c
index 456e813..7e20c3f 100644
--- a/examples/aom_cx_set_ref.c
+++ b/examples/aom_cx_set_ref.c
@@ -111,8 +111,7 @@
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
int got_data;
- const aom_codec_err_t res =
- aom_codec_encode(ecodec, img, frame_in, 1, 0, AOM_DL_GOOD_QUALITY);
+ const aom_codec_err_t res = aom_codec_encode(ecodec, img, frame_in, 1, 0);
if (res != AOM_CODEC_OK) die_codec(ecodec, "Failed to encode frame");
got_data = 0;
@@ -139,7 +138,7 @@
// Decode 1 frame.
if (test_decode) {
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.");
}
}
diff --git a/examples/decode_to_md5.c b/examples/decode_to_md5.c
index 5ab2532..75bb97d 100644
--- a/examples/decode_to_md5.c
+++ b/examples/decode_to_md5.c
@@ -110,7 +110,7 @@
size_t frame_size = 0;
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))
die_codec(&codec, "Failed to decode frame");
while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) {
diff --git a/examples/decode_with_drops.c b/examples/decode_with_drops.c
index 45e0fb0..c2f3c54 100644
--- a/examples/decode_with_drops.c
+++ b/examples/decode_with_drops.c
@@ -116,7 +116,7 @@
int skip;
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))
die_codec(&codec, "Failed to decode frame.");
++frame_cnt;
diff --git a/examples/inspect.c b/examples/inspect.c
index a78c4e4..bf02579 100644
--- a/examples/inspect.c
+++ b/examples/inspect.c
@@ -663,7 +663,7 @@
aom_codec_iter_t iter = NULL;
size_t frame_size = 0;
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) {
die_codec(&codec, "Failed to decode frame.");
}
diff --git a/examples/lightfield_decoder.c b/examples/lightfield_decoder.c
index 8189425..be5b52c 100644
--- a/examples/lightfield_decoder.c
+++ b/examples/lightfield_decoder.c
@@ -137,7 +137,7 @@
size_t frame_size = 0;
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))
die_codec(&codec, "Failed to decode frame.");
while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) {
@@ -176,7 +176,7 @@
aom_codec_control_(&codec, AV1_SET_DECODE_TILE_ROW, tile_t);
aom_codec_control_(&codec, AV1_SET_DECODE_TILE_COL, tile_s);
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.");
aom_codec_iter_t iter = NULL;
aom_image_t *img = aom_codec_get_frame(&codec, &iter);
diff --git a/examples/lightfield_encoder.c b/examples/lightfield_encoder.c
index c45fb03..535c0c3 100644
--- a/examples/lightfield_encoder.c
+++ b/examples/lightfield_encoder.c
@@ -43,7 +43,6 @@
#include "../video_writer.h"
static const char *exec_name;
-static const unsigned int deadline = AOM_DL_GOOD_QUALITY;
void usage_exit(void) {
fprintf(stderr,
@@ -92,13 +91,12 @@
static int get_frame_stats(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned int duration,
- aom_enc_frame_flags_t flags, unsigned int dl,
+ aom_enc_frame_flags_t flags,
aom_fixed_buf_t *stats) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
- const aom_codec_err_t res =
- aom_codec_encode(ctx, img, pts, duration, flags, dl);
+ const aom_codec_err_t res = aom_codec_encode(ctx, img, pts, duration, flags);
if (res != AOM_CODEC_OK) die_codec(ctx, "Failed to get frame stats.");
while ((pkt = aom_codec_get_cx_data(ctx, &iter)) != NULL) {
@@ -118,13 +116,11 @@
static int encode_frame(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned int duration,
- aom_enc_frame_flags_t flags, unsigned int dl,
- AvxVideoWriter *writer) {
+ aom_enc_frame_flags_t flags AvxVideoWriter *writer) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
- const aom_codec_err_t res =
- aom_codec_encode(ctx, img, pts, duration, flags, dl);
+ const aom_codec_err_t res = aom_codec_encode(ctx, img, pts, duration, flags);
if (res != AOM_CODEC_OK) die_codec(ctx, "Failed to encode frame.");
while ((pkt = aom_codec_get_cx_data(ctx, &iter)) != NULL) {
@@ -197,7 +193,7 @@
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
AOM_EFLAG_NO_UPD_ARF,
- deadline, &stats);
+ &stats);
ref_frame.idx = 0;
aom_codec_control(&codec, AV1_GET_REFERENCE, &ref_frame);
aom_img_copy(&ref_frame.img, &reference_images[frame_count - 1]);
@@ -234,14 +230,14 @@
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
AOM_EFLAG_NO_UPD_ARF | AOM_EFLAG_NO_UPD_ENTROPY,
- deadline, &stats);
+ &stats);
}
}
}
}
// Flush encoder.
// No ARF, this should not be needed.
- while (get_frame_stats(&codec, NULL, frame_count, 1, 0, deadline, &stats)) {
+ while (get_frame_stats(&codec, NULL, frame_count, 1, 0, &stats)) {
}
printf("Pass 0 complete. Processed %d frames.\n", frame_count);
@@ -310,7 +306,7 @@
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
AOM_EFLAG_NO_UPD_ARF | AOM_EFLAG_NO_UPD_ENTROPY,
- deadline, writer);
+ writer);
ref_frame.idx = 0;
aom_codec_control(&codec, AV1_GET_REFERENCE, &ref_frame);
aom_img_copy(&ref_frame.img, &reference_images[frame_count - 1]);
@@ -366,7 +362,7 @@
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
AOM_EFLAG_NO_UPD_ARF | AOM_EFLAG_NO_UPD_ENTROPY,
- deadline, writer);
+ writer);
}
}
}
@@ -374,7 +370,7 @@
// Flush encoder.
// No ARF, this should not be needed.
- while (encode_frame(&codec, NULL, -1, 1, 0, deadline, writer)) {
+ while (encode_frame(&codec, NULL, -1, 1, 0, writer)) {
}
if (aom_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
diff --git a/examples/lossless_encoder.c b/examples/lossless_encoder.c
index 32ab18a..242db7b 100644
--- a/examples/lossless_encoder.c
+++ b/examples/lossless_encoder.c
@@ -35,7 +35,7 @@
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
const aom_codec_err_t res =
- aom_codec_encode(codec, img, frame_index, 1, flags, AOM_DL_GOOD_QUALITY);
+ aom_codec_encode(codec, img, frame_index, 1, flags);
if (res != AOM_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = aom_codec_get_cx_data(codec, &iter)) != NULL) {
diff --git a/examples/set_maps.c b/examples/set_maps.c
index 3a54e5f..82d98e1 100644
--- a/examples/set_maps.c
+++ b/examples/set_maps.c
@@ -95,8 +95,7 @@
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
- const aom_codec_err_t res =
- aom_codec_encode(codec, img, frame_index, 1, 0, AOM_DL_GOOD_QUALITY);
+ const aom_codec_err_t res = aom_codec_encode(codec, img, frame_index, 1, 0);
if (res != AOM_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = aom_codec_get_cx_data(codec, &iter)) != NULL) {
diff --git a/examples/simple_decoder.c b/examples/simple_decoder.c
index 33a8945..e7c6a7d 100644
--- a/examples/simple_decoder.c
+++ b/examples/simple_decoder.c
@@ -49,9 +49,7 @@
// `aom_codec_decode` function. The call takes a pointer to the data
// (`frame`) and the length of the data (`frame_size`). No application data
// is associated with the frame in this example, so the `user_priv`
-// parameter is NULL. The `deadline` parameter is left at zero for this
-// example. This parameter is generally only used when doing adaptive post
-// processing.
+// parameter is NULL.
//
// Codecs may produce a variable number of output frames for every call to
// `aom_codec_decode`. These frames are retrieved by the
@@ -127,7 +125,7 @@
size_t frame_size = 0;
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))
die_codec(&codec, "Failed to decode frame.");
while ((img = aom_codec_get_frame(&codec, &iter)) != NULL) {
diff --git a/examples/simple_encoder.c b/examples/simple_encoder.c
index 996f6da..5a54518 100644
--- a/examples/simple_encoder.c
+++ b/examples/simple_encoder.c
@@ -121,7 +121,7 @@
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
const aom_codec_err_t res =
- aom_codec_encode(codec, img, frame_index, 1, flags, AOM_DL_GOOD_QUALITY);
+ aom_codec_encode(codec, img, frame_index, 1, flags);
if (res != AOM_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = aom_codec_get_cx_data(codec, &iter)) != NULL) {
diff --git a/examples/twopass_encoder.c b/examples/twopass_encoder.c
index e767bb5..bb4b150 100644
--- a/examples/twopass_encoder.c
+++ b/examples/twopass_encoder.c
@@ -68,13 +68,12 @@
static int get_frame_stats(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned int duration,
- aom_enc_frame_flags_t flags, unsigned int deadline,
+ aom_enc_frame_flags_t flags,
aom_fixed_buf_t *stats) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
- const aom_codec_err_t res =
- aom_codec_encode(ctx, img, pts, duration, flags, deadline);
+ const aom_codec_err_t res = aom_codec_encode(ctx, img, pts, duration, flags);
if (res != AOM_CODEC_OK) die_codec(ctx, "Failed to get frame stats.");
while ((pkt = aom_codec_get_cx_data(ctx, &iter)) != NULL) {
@@ -94,13 +93,11 @@
static int encode_frame(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned int duration,
- aom_enc_frame_flags_t flags, unsigned int deadline,
- AvxVideoWriter *writer) {
+ aom_enc_frame_flags_t flags, AvxVideoWriter *writer) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
- const aom_codec_err_t res =
- aom_codec_encode(ctx, img, pts, duration, flags, deadline);
+ const aom_codec_err_t res = aom_codec_encode(ctx, img, pts, duration, flags);
if (res != AOM_CODEC_OK) die_codec(ctx, "Failed to encode frame.");
while ((pkt = aom_codec_get_cx_data(ctx, &iter)) != NULL) {
@@ -133,13 +130,11 @@
// Calculate frame statistics.
while (aom_img_read(raw, infile) && frame_count < limit) {
++frame_count;
- get_frame_stats(&codec, raw, frame_count, 1, 0, AOM_DL_GOOD_QUALITY,
- &stats);
+ get_frame_stats(&codec, raw, frame_count, 1, 0, &stats);
}
// Flush encoder.
- while (get_frame_stats(&codec, NULL, frame_count, 1, 0, AOM_DL_GOOD_QUALITY,
- &stats)) {
+ while (get_frame_stats(&codec, NULL, frame_count, 1, 0, &stats)) {
}
printf("Pass 0 complete. Processed %d frames.\n", frame_count);
@@ -168,11 +163,11 @@
// Encode frames.
while (aom_img_read(raw, infile) && frame_count < limit) {
++frame_count;
- encode_frame(&codec, raw, frame_count, 1, 0, AOM_DL_GOOD_QUALITY, writer);
+ encode_frame(&codec, raw, frame_count, 1, 0, writer);
}
// Flush encoder.
- while (encode_frame(&codec, NULL, -1, 1, 0, AOM_DL_GOOD_QUALITY, writer)) {
+ while (encode_frame(&codec, NULL, -1, 1, 0, writer)) {
}
printf("\n");
diff --git a/test/codec_factory.h b/test/codec_factory.h
index d2f20b8..5873801 100644
--- a/test/codec_factory.h
+++ b/test/codec_factory.h
@@ -39,7 +39,6 @@
const aom_codec_flags_t flags) const = 0;
virtual Encoder *CreateEncoder(aom_codec_enc_cfg_t cfg,
- unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const = 0;
@@ -89,9 +88,9 @@
class AV1Encoder : public Encoder {
public:
- AV1Encoder(aom_codec_enc_cfg_t cfg, unsigned long deadline,
- const unsigned long init_flags, TwopassStatsStore *stats)
- : Encoder(cfg, deadline, init_flags, stats) {}
+ AV1Encoder(aom_codec_enc_cfg_t cfg, const uint32_t init_flags,
+ TwopassStatsStore *stats)
+ : Encoder(cfg, init_flags, stats) {}
protected:
virtual aom_codec_iface_t *CodecInterface() const {
@@ -123,14 +122,12 @@
}
virtual Encoder *CreateEncoder(aom_codec_enc_cfg_t cfg,
- unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
#if CONFIG_AV1_ENCODER
- return new AV1Encoder(cfg, deadline, init_flags, stats);
+ return new AV1Encoder(cfg, init_flags, stats);
#else
(void)cfg;
- (void)deadline;
(void)init_flags;
(void)stats;
return NULL;
diff --git a/test/coding_path_sync.cc b/test/coding_path_sync.cc
index aa25edd..fa9cbbb 100644
--- a/test/coding_path_sync.cc
+++ b/test/coding_path_sync.cc
@@ -89,7 +89,7 @@
aom_image_t img;
aom_img_wrap(&img, format_, width_, height_, 0, buf);
- aom_codec_encode(&enc_, &img, frame_count_++, 1, 0, 0);
+ aom_codec_encode(&enc_, &img, frame_count_++, 1, 0);
aom_codec_iter_t iter = NULL;
@@ -150,7 +150,7 @@
std::vector<int16_t> decode(const aom_codec_cx_pkt_t *pkt) {
aom_codec_decode(&dec_, static_cast<uint8_t *>(pkt->data.frame.buf),
- static_cast<unsigned int>(pkt->data.frame.sz), NULL, 0);
+ static_cast<unsigned int>(pkt->data.frame.sz), NULL);
aom_codec_iter_t iter = NULL;
return Serialize(aom_codec_get_frame(&dec_, &iter));
diff --git a/test/decode_api_test.cc b/test/decode_api_test.cc
index 9eb34b8..121e522 100644
--- a/test/decode_api_test.cc
+++ b/test/decode_api_test.cc
@@ -30,12 +30,12 @@
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_dec_init(NULL, NULL, NULL, 0));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_dec_init(&dec, NULL, NULL, 0));
- EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(NULL, NULL, 0, NULL, 0));
- EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(NULL, buf, 0, NULL, 0));
+ EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(NULL, NULL, 0, NULL));
+ EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(NULL, buf, 0, NULL));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
- aom_codec_decode(NULL, buf, NELEMENTS(buf), NULL, 0));
+ aom_codec_decode(NULL, buf, NELEMENTS(buf), NULL));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
- aom_codec_decode(NULL, NULL, NELEMENTS(buf), NULL, 0));
+ aom_codec_decode(NULL, NULL, NELEMENTS(buf), NULL));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_destroy(NULL));
EXPECT_TRUE(aom_codec_error(NULL) != NULL);
@@ -47,11 +47,11 @@
#if !CONFIG_OBU
// Needs to be fixed
EXPECT_EQ(AOM_CODEC_UNSUP_BITSTREAM,
- aom_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0));
+ aom_codec_decode(&dec, buf, NELEMENTS(buf), NULL));
#endif
EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
- aom_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0));
- EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(&dec, buf, 0, NULL, 0));
+ aom_codec_decode(&dec, NULL, NELEMENTS(buf), NULL));
+ EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(&dec, buf, 0, NULL));
EXPECT_EQ(AOM_CODEC_OK, aom_codec_destroy(&dec));
}
diff --git a/test/decode_test_driver.cc b/test/decode_test_driver.cc
index 4d5e8f7..61dd73d 100644
--- a/test/decode_test_driver.cc
+++ b/test/decode_test_driver.cc
@@ -36,8 +36,8 @@
aom_codec_err_t res_dec;
InitOnce();
API_REGISTER_STATE_CHECK(
- res_dec = aom_codec_decode(
- &decoder_, cxdata, static_cast<unsigned int>(size), user_priv, 0));
+ res_dec = aom_codec_decode(&decoder_, cxdata,
+ static_cast<unsigned int>(size), user_priv));
return res_dec;
}
diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc
index 31aedca..32eb554 100644
--- a/test/encode_api_test.cc
+++ b/test/encode_api_test.cc
@@ -33,8 +33,8 @@
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_enc_init(NULL, NULL, NULL, 0));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_enc_init(&enc, NULL, NULL, 0));
- EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_encode(NULL, NULL, 0, 0, 0, 0));
- EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_encode(NULL, &img, 0, 0, 0, 0));
+ EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_encode(NULL, NULL, 0, 0, 0));
+ EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_encode(NULL, &img, 0, 0, 0));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_destroy(NULL));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
aom_codec_enc_config_default(NULL, NULL, 0));
@@ -53,7 +53,7 @@
EXPECT_EQ(AOM_CODEC_OK, aom_codec_enc_config_default(kCodecs[i], &cfg, 0));
EXPECT_EQ(AOM_CODEC_OK, aom_codec_enc_init(&enc, kCodecs[i], &cfg, 0));
- EXPECT_EQ(AOM_CODEC_OK, aom_codec_encode(&enc, NULL, 0, 0, 0, 0));
+ EXPECT_EQ(AOM_CODEC_OK, aom_codec_encode(&enc, NULL, 0, 0, 0));
EXPECT_EQ(AOM_CODEC_OK, aom_codec_destroy(&enc));
}
diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc
index 5a23e23..bccedc8 100644
--- a/test/encode_test_driver.cc
+++ b/test/encode_test_driver.cc
@@ -82,15 +82,14 @@
}
// Encode the frame
- API_REGISTER_STATE_CHECK(res = aom_codec_encode(&encoder_, img, video.pts(),
- video.duration(), frame_flags,
- deadline_));
+ API_REGISTER_STATE_CHECK(res =
+ aom_codec_encode(&encoder_, img, video.pts(),
+ video.duration(), frame_flags));
ASSERT_EQ(AOM_CODEC_OK, res) << EncoderError();
}
void Encoder::Flush() {
- const aom_codec_err_t res =
- aom_codec_encode(&encoder_, NULL, 0, 0, 0, deadline_);
+ const aom_codec_err_t res = aom_codec_encode(&encoder_, NULL, 0, 0, 0);
if (!encoder_.priv)
ASSERT_EQ(AOM_CODEC_ERROR, res) << EncoderError();
else
@@ -105,11 +104,8 @@
void EncoderTest::SetMode(TestMode mode) {
switch (mode) {
case kOnePassGood:
- case kTwoPassGood: deadline_ = AOM_DL_GOOD_QUALITY; break;
- case kRealTime:
- deadline_ = AOM_DL_GOOD_QUALITY;
- cfg_.g_lag_in_frames = 0;
- break;
+ case kTwoPassGood: break;
+ case kRealTime: cfg_.g_lag_in_frames = 0; break;
default: ASSERT_TRUE(false) << "Unexpected mode " << mode;
}
mode_ = mode;
@@ -217,7 +213,7 @@
BeginPassHook(pass);
testing::internal::scoped_ptr<Encoder> encoder(
- codec_->CreateEncoder(cfg_, deadline_, init_flags_, &stats_));
+ codec_->CreateEncoder(cfg_, init_flags_, &stats_));
ASSERT_TRUE(encoder.get() != NULL);
ASSERT_NO_FATAL_FAILURE(video->Begin());
diff --git a/test/encode_test_driver.h b/test/encode_test_driver.h
index 97c1bf8..c6524e5 100644
--- a/test/encode_test_driver.h
+++ b/test/encode_test_driver.h
@@ -78,9 +78,9 @@
// level of abstraction will be fleshed out as more tests are written.
class Encoder {
public:
- Encoder(aom_codec_enc_cfg_t cfg, unsigned long deadline,
- const unsigned long init_flags, TwopassStatsStore *stats)
- : cfg_(cfg), deadline_(deadline), init_flags_(init_flags), stats_(stats) {
+ Encoder(aom_codec_enc_cfg_t cfg, const uint32_t init_flags,
+ TwopassStatsStore *stats)
+ : cfg_(cfg), init_flags_(init_flags), stats_(stats) {
memset(&encoder_, 0, sizeof(encoder_));
}
@@ -128,8 +128,6 @@
cfg_ = *cfg;
}
- void set_deadline(unsigned long deadline) { deadline_ = deadline; }
-
protected:
virtual aom_codec_iface_t *CodecInterface() const = 0;
@@ -147,7 +145,6 @@
aom_codec_ctx_t encoder_;
aom_codec_enc_cfg_t cfg_;
- unsigned long deadline_;
unsigned long init_flags_;
TwopassStatsStore *stats_;
};
@@ -173,7 +170,7 @@
// Initialize the cfg_ member with the default configuration.
void InitializeConfig();
- // Map the TestMode enum to the deadline_ and passes_ variables.
+ // Map the TestMode enum to the passes_ variables.
void SetMode(TestMode mode);
// Set encoder flag.
@@ -233,7 +230,6 @@
bool abort_;
aom_codec_enc_cfg_t cfg_;
unsigned int passes_;
- unsigned long deadline_;
TwopassStatsStore stats_;
unsigned long init_flags_;
unsigned long frame_flags_;
diff --git a/usage.dox b/usage.dox
index 59239e8..062d35a 100644
--- a/usage.dox
+++ b/usage.dox
@@ -108,28 +108,4 @@
(comprised of characters in the set [a-z_a-Z0-9+/]). This information is not
useful to an application at runtime, but may be of use to aom for support.
-
- \section usage_deadline Deadline
- Both the encoding and decoding functions have a <code>deadline</code>
- parameter. This parameter indicates the amount of time, in microseconds
- (us), that the application wants the codec to spend processing before
- returning. This is a soft deadline -- that is, the semantics of the
- requested operation take precedence over meeting the deadline. If, for
- example, an application sets a <code>deadline</code> of 1000us, and the
- frame takes 2000us to decode, the call to aom_codec_decode() will return
- after 2000us. In this case the deadline is not met, but the semantics of the
- function are preserved. If, for the same frame, an application instead sets
- a <code>deadline</code> of 5000us, the decoder will see that it has 3000us
- remaining in its time slice when decoding completes. It could then choose to
- run a set of \ref usage_postproc filters, and perhaps would return after
- 4000us (instead of the allocated 5000us). In this case the deadline is met,
- and the semantics of the call are preserved, as before.
-
- The special value <code>0</code> is reserved to represent an infinite
- deadline. In this case, the codec will perform as much processing as
- possible to yield the highest quality frame.
-
- By convention, the value <code>1</code> is used to mean "return as fast as
- possible."
-
*/
diff --git a/usage_cx.dox b/usage_cx.dox
index dcf267c..51b4e8e 100644
--- a/usage_cx.dox
+++ b/usage_cx.dox
@@ -2,11 +2,7 @@
The aom_codec_encode() function is at the core of the encode loop. It
processes raw images passed by the application, producing packets of
- compressed data. The <code>deadline</code> parameter controls the amount
- of time in microseconds the encoder should spend working on the frame. For
- more information on the <code>deadline</code> parameter, see
- \ref usage_deadline.
-
+ compressed data.
\ref samples
diff --git a/usage_dx.dox b/usage_dx.dox
index 6b76bf7..eef7837 100644
--- a/usage_dx.dox
+++ b/usage_dx.dox
@@ -5,11 +5,7 @@
decoded images. The decoder expects packets to comprise exactly one image
frame of data. Packets \ref MUST be passed in decode order. If the
application wishes to associate some data with the frame, the
- <code>user_priv</code> member may be set. The <code>deadline</code>
- parameter controls the amount of time in microseconds the decoder should
- spend working on the frame. This is typically used to support adaptive
- \ref usage_postproc based on the amount of free CPU time. For more
- information on the <code>deadline</code> parameter, see \ref usage_deadline.
+ <code>user_priv</code> member may be set.
\ref samples
@@ -55,8 +51,7 @@
postprocessing filters, and the available filters may differ from platform
to platform. Embedded devices often do not have enough CPU to implement
postprocessing in software. The filter selection is generally handled
- automatically by the codec, depending on the amount of time remaining before
- hitting the user-specified \ref usage_deadline after decoding the frame.
+ automatically by the codec.
*/