diff mbox series

[FFmpeg-devel,2/3] avcodec/av1dec: remove order_hint from AV1Frame

Message ID 20201112205213.1179-2-jamrial@gmail.com
State Accepted
Commit 5d4a6bbd4b011b49b60563a1bc390d8d04fe1e17
Headers show
Series [FFmpeg-devel,1/3] avcodec/av1dec: add a reference to the raw frame header to AV1Frames
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

James Almer Nov. 12, 2020, 8:52 p.m. UTC
We now have access to the raw frame header, so use that

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/av1dec.c | 8 ++------
 libavcodec/av1dec.h | 1 -
 2 files changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 84c9ca93d5..c1967f03bd 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -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);
diff --git a/libavcodec/av1dec.h b/libavcodec/av1dec.h
index 533ca2b30f..4b218f64bb 100644
--- a/libavcodec/av1dec.h
+++ b/libavcodec/av1dec.h
@@ -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;