1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/av1dec: remove order_hint from AV1Frame

We now have access to the raw frame header, so use that

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2020-11-12 17:06:05 -03:00
parent f5517be32a
commit 5d4a6bbd4b
2 changed files with 2 additions and 7 deletions

View File

@ -169,7 +169,7 @@ static void skip_mode_params(AV1DecContext *s)
forward_idx = -1;
backward_idx = -1;
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
ref_hint = s->ref[header->ref_frame_idx[i]].order_hint;
ref_hint = s->ref[header->ref_frame_idx[i]].raw_frame_header->order_hint;
dist = get_relative_dist(seq, ref_hint, header->order_hint);
if (dist < 0) {
if (forward_idx < 0 ||
@ -198,7 +198,7 @@ static void skip_mode_params(AV1DecContext *s)
second_forward_idx = -1;
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
ref_hint = s->ref[header->ref_frame_idx[i]].order_hint;
ref_hint = s->ref[header->ref_frame_idx[i]].raw_frame_header->order_hint;
if (get_relative_dist(seq, ref_hint, forward_hint) < 0) {
if (second_forward_idx < 0 ||
get_relative_dist(seq, ref_hint, second_forward_hint) > 0) {
@ -445,7 +445,6 @@ static void av1_frame_unref(AVCodecContext *avctx, AV1Frame *f)
av_buffer_unref(&f->header_ref);
f->raw_frame_header = NULL;
f->spatial_id = f->temporal_id = 0;
f->order_hint = 0;
memset(f->skip_mode_frame_idx, 0,
2 * sizeof(uint8_t));
f->coded_lossless = 0;
@ -480,7 +479,6 @@ static int av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *s
memcpy(dst->gm_params,
src->gm_params,
AV1_NUM_REF_FRAMES * 6 * sizeof(int32_t));
dst->order_hint = src->order_hint;
memcpy(dst->skip_mode_frame_idx,
src->skip_mode_frame_idx,
2 * sizeof(uint8_t));
@ -890,8 +888,6 @@ static int av1_decode_frame(AVCodecContext *avctx, void *frame,
s->cur_frame.spatial_id = header->spatial_id;
s->cur_frame.temporal_id = header->temporal_id;
s->cur_frame.order_hint = s->raw_frame_header->order_hint;
if (avctx->hwaccel) {
ret = avctx->hwaccel->start_frame(avctx, unit->data,
unit->data_size);

View File

@ -45,7 +45,6 @@ typedef struct AV1Frame {
uint8_t gm_type[AV1_NUM_REF_FRAMES];
int32_t gm_params[AV1_NUM_REF_FRAMES][6];
uint8_t order_hint;
uint8_t skip_mode_frame_idx[2];
uint8_t coded_lossless;