[FFmpeg-cvslog] avcodec/av1dec: don't derive loop filter delta parameters

James Almer git at videolan.org
Wed Oct 28 16:49:59 EET 2020


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Oct 20 19:37:28 2020 -0300| [7dac8ddb20ee663ca211bd8c152228536a884605] | committer: James Almer

avcodec/av1dec: don't derive loop filter delta parameters

This is now handled by CBS.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7dac8ddb20ee663ca211bd8c152228536a884605
---

 libavcodec/av1dec.c | 60 -----------------------------------------------------
 libavcodec/av1dec.h |  3 ---
 2 files changed, 63 deletions(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index bb4295aa6f..e01ac6641a 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -26,54 +26,6 @@
 #include "internal.h"
 #include "profiles.h"
 
-static void setup_past_independence(AV1Frame *f)
-{
-    f->loop_filter_delta_enabled = 1;
-
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_INTRA] = 1;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_LAST] = 0;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_LAST2] = 0;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_LAST3] = 0;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_GOLDEN] = -1;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_BWDREF] = 0;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_ALTREF2] = -1;
-    f->loop_filter_ref_deltas[AV1_REF_FRAME_ALTREF] = -1;
-
-    f->loop_filter_mode_deltas[0] = 0;
-    f->loop_filter_mode_deltas[1] = 0;
-}
-
-static void load_previous_and_update(AV1DecContext *s)
-{
-    uint8_t primary_frame, prev_frame;
-
-    primary_frame = s->raw_frame_header->primary_ref_frame;
-    prev_frame = s->raw_frame_header->ref_frame_idx[primary_frame];
-    memcpy(s->cur_frame.loop_filter_ref_deltas,
-           s->ref[prev_frame].loop_filter_ref_deltas,
-           AV1_NUM_REF_FRAMES * sizeof(int8_t));
-    memcpy(s->cur_frame.loop_filter_mode_deltas,
-           s->ref[prev_frame].loop_filter_mode_deltas,
-           2 * sizeof(int8_t));
-
-    if (s->raw_frame_header->loop_filter_delta_update) {
-        for (int i = 0; i < AV1_NUM_REF_FRAMES; i++) {
-            if (s->raw_frame_header->update_ref_delta[i])
-                s->cur_frame.loop_filter_ref_deltas[i] =
-                    s->raw_frame_header->loop_filter_ref_deltas[i];
-        }
-
-        for (int i = 0; i < 2; i++) {
-            if (s->raw_frame_header->update_mode_delta[i])
-                s->cur_frame.loop_filter_mode_deltas[i] =
-                    s->raw_frame_header->loop_filter_mode_deltas[i];
-        }
-    }
-
-    s->cur_frame.loop_filter_delta_enabled =
-        s->raw_frame_header->loop_filter_delta_enabled;
-}
-
 static uint32_t inverse_recenter(int r, uint32_t v)
 {
     if (v > 2 * r)
@@ -363,13 +315,6 @@ static int av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *s
 
     dst->spatial_id = src->spatial_id;
     dst->temporal_id = src->temporal_id;
-    dst->loop_filter_delta_enabled = src->loop_filter_delta_enabled;
-    memcpy(dst->loop_filter_ref_deltas,
-           src->loop_filter_ref_deltas,
-           AV1_NUM_REF_FRAMES * sizeof(int8_t));
-    memcpy(dst->loop_filter_mode_deltas,
-           src->loop_filter_mode_deltas,
-           2 * sizeof(int8_t));
     memcpy(dst->gm_type,
            src->gm_type,
            AV1_NUM_REF_FRAMES * sizeof(uint8_t));
@@ -645,11 +590,6 @@ static int get_current_frame(AVCodecContext *avctx)
         return ret;
     }
 
-    if (s->raw_frame_header->primary_ref_frame == AV1_PRIMARY_REF_NONE)
-        setup_past_independence(&s->cur_frame);
-    else
-        load_previous_and_update(s);
-
     global_motion_params(s);
 
     return ret;
diff --git a/libavcodec/av1dec.h b/libavcodec/av1dec.h
index 63c958ca53..b58bc53961 100644
--- a/libavcodec/av1dec.h
+++ b/libavcodec/av1dec.h
@@ -39,9 +39,6 @@ typedef struct AV1Frame {
     int temporal_id;
     int spatial_id;
 
-    uint8_t loop_filter_delta_enabled;
-    int8_t  loop_filter_ref_deltas[AV1_NUM_REF_FRAMES];
-    int8_t  loop_filter_mode_deltas[2];
     uint8_t gm_type[AV1_NUM_REF_FRAMES];
     int32_t gm_params[AV1_NUM_REF_FRAMES][6];
 } AV1Frame;



More information about the ffmpeg-cvslog mailing list