summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/av1_dx_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_dx_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_dx_iface.c')
-rw-r--r--third_party/aom/av1/av1_dx_iface.c56
1 files changed, 33 insertions, 23 deletions
diff --git a/third_party/aom/av1/av1_dx_iface.c b/third_party/aom/av1/av1_dx_iface.c
index df2c81dc9..c2f433d38 100644
--- a/third_party/aom/av1/av1_dx_iface.c
+++ b/third_party/aom/av1/av1_dx_iface.c
@@ -153,6 +153,7 @@ static aom_codec_err_t decoder_destroy(aom_codec_alg_priv_t *ctx) {
return AOM_CODEC_OK;
}
+#if !CONFIG_OBU
static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile,
struct aom_read_bit_buffer *rb) {
aom_color_space_t color_space;
@@ -200,6 +201,7 @@ static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile,
}
return 1;
}
+#endif
static aom_codec_err_t decoder_peek_si_internal(
const uint8_t *data, unsigned int data_sz, aom_codec_stream_info_t *si,
@@ -229,9 +231,18 @@ static aom_codec_err_t decoder_peek_si_internal(
data += index_size;
data_sz -= index_size;
+#if CONFIG_OBU
+ if (data + data_sz <= data) return AOM_CODEC_INVALID_PARAM;
+#endif
}
{
+#if CONFIG_OBU
+ // Proper fix needed
+ si->is_kf = 1;
+ intra_only_flag = 1;
+ si->h = 1;
+#else
int show_frame;
int error_resilient;
struct aom_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL };
@@ -261,35 +272,35 @@ static aom_codec_err_t decoder_peek_si_internal(
si->is_kf = !aom_rb_read_bit(&rb);
show_frame = aom_rb_read_bit(&rb);
+ if (!si->is_kf) {
+ if (!show_frame) intra_only_flag = show_frame ? 0 : aom_rb_read_bit(&rb);
+ }
error_resilient = aom_rb_read_bit(&rb);
#if CONFIG_REFERENCE_BUFFER
- {
+ SequenceHeader seq_params = { 0, 0, 0 };
+ if (si->is_kf) {
/* TODO: Move outside frame loop or inside key-frame branch */
- int frame_id_len;
- SequenceHeader seq_params;
- read_sequence_header(&seq_params);
+ read_sequence_header(&seq_params, &rb);
#if CONFIG_EXT_TILE
if (large_scale_tile) seq_params.frame_id_numbers_present_flag = 0;
#endif // CONFIG_EXT_TILE
- if (seq_params.frame_id_numbers_present_flag) {
- frame_id_len = seq_params.frame_id_length_minus7 + 7;
- aom_rb_read_literal(&rb, frame_id_len);
- }
}
-#endif
+#endif // CONFIG_REFERENCE_BUFFER
+#if CONFIG_REFERENCE_BUFFER
+ if (seq_params.frame_id_numbers_present_flag) {
+ int frame_id_len;
+ frame_id_len = seq_params.frame_id_length_minus7 + 7;
+ aom_rb_read_literal(&rb, frame_id_len);
+ }
+#endif // CONFIG_REFERENCE_BUFFER
if (si->is_kf) {
- if (!av1_read_sync_code(&rb)) return AOM_CODEC_UNSUP_BITSTREAM;
-
if (!parse_bitdepth_colorspace_sampling(profile, &rb))
return AOM_CODEC_UNSUP_BITSTREAM;
av1_read_frame_size(&rb, (int *)&si->w, (int *)&si->h);
} else {
- intra_only_flag = show_frame ? 0 : aom_rb_read_bit(&rb);
-
rb.bit_offset += error_resilient ? 0 : 2; // reset_frame_context
if (intra_only_flag) {
- if (!av1_read_sync_code(&rb)) return AOM_CODEC_UNSUP_BITSTREAM;
if (profile > PROFILE_0) {
if (!parse_bitdepth_colorspace_sampling(profile, &rb))
return AOM_CODEC_UNSUP_BITSTREAM;
@@ -298,6 +309,7 @@ static aom_codec_err_t decoder_peek_si_internal(
av1_read_frame_size(&rb, (int *)&si->w, (int *)&si->h);
}
}
+#endif // CONFIG_OBU
}
if (is_intra_only != NULL) *is_intra_only = intra_only_flag;
return AOM_CODEC_OK;
@@ -876,7 +888,7 @@ static aom_codec_err_t decoder_set_fb_fn(
static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx,
va_list args) {
- aom_ref_frame_t *const data = va_arg(args, aom_ref_frame_t *);
+ av1_ref_frame_t *const data = va_arg(args, av1_ref_frame_t *);
// Only support this function in serial decode.
if (ctx->frame_parallel_decode) {
@@ -885,13 +897,12 @@ static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx,
}
if (data) {
- aom_ref_frame_t *const frame = (aom_ref_frame_t *)data;
+ av1_ref_frame_t *const frame = data;
YV12_BUFFER_CONFIG sd;
AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
image2yuvconfig(&frame->img, &sd);
- return av1_set_reference_dec(&frame_worker_data->pbi->common,
- ref_frame_to_av1_reframe(frame->frame_type),
+ return av1_set_reference_dec(&frame_worker_data->pbi->common, frame->idx,
&sd);
} else {
return AOM_CODEC_INVALID_PARAM;
@@ -900,7 +911,7 @@ 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) {
- const aom_ref_frame_t *const frame = va_arg(args, aom_ref_frame_t *);
+ const av1_ref_frame_t *const frame = va_arg(args, av1_ref_frame_t *);
// Only support this function in serial decode.
if (ctx->frame_parallel_decode) {
@@ -913,8 +924,7 @@ static aom_codec_err_t ctrl_copy_reference(aom_codec_alg_priv_t *ctx,
AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
image2yuvconfig(&frame->img, &sd);
- return av1_copy_reference_dec(frame_worker_data->pbi,
- (AOM_REFFRAME)frame->frame_type, &sd);
+ return av1_copy_reference_dec(frame_worker_data->pbi, frame->idx, &sd);
} else {
return AOM_CODEC_INVALID_PARAM;
}
@@ -1209,10 +1219,10 @@ static aom_codec_err_t ctrl_set_inspection_callback(aom_codec_alg_priv_t *ctx,
}
static aom_codec_ctrl_fn_map_t decoder_ctrl_maps[] = {
- { AOM_COPY_REFERENCE, ctrl_copy_reference },
+ { AV1_COPY_REFERENCE, ctrl_copy_reference },
// Setters
- { AOM_SET_REFERENCE, ctrl_set_reference },
+ { AV1_SET_REFERENCE, ctrl_set_reference },
{ AOM_SET_POSTPROC, ctrl_set_postproc },
{ AOM_SET_DBG_COLOR_REF_FRAME, ctrl_set_dbg_options },
{ AOM_SET_DBG_COLOR_MB_MODES, ctrl_set_dbg_options },