diff mbox series

[FFmpeg-devel,07/19] avcodec/vc1: Move setting res_fasttx-IDCT functions to vc1dec.c

Message ID GV1P250MB0737F8F713A87322D7D927588F349@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 777a8c2d500c3423a3a55b57752b18e88e876a2f
Headers show
Series [FFmpeg-devel,01/19] avcodec/vc1: Don't check for AVCodecContext.codec | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 30, 2022, 11:56 p.m. UTC
It allows to avoid compiling simple_idct.o for the VC-1 parser.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/Makefile |  2 +-
 libavcodec/vc1.c    | 11 -----------
 libavcodec/vc1dec.c |  9 +++++++++
 3 files changed, 10 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 72d2f92901..739bf757f9 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1169,7 +1169,7 @@  OBJS-$(CONFIG_SBC_PARSER)              += sbc_parser.o
 OBJS-$(CONFIG_SIPR_PARSER)             += sipr_parser.o
 OBJS-$(CONFIG_TAK_PARSER)              += tak_parser.o tak.o
 OBJS-$(CONFIG_VC1_PARSER)              += vc1_parser.o vc1.o vc1data.o  \
-                                          simple_idct.o wmv2data.o
+                                          wmv2data.o
 OBJS-$(CONFIG_VP3_PARSER)              += vp3_parser.o
 OBJS-$(CONFIG_VP8_PARSER)              += vp8_parser.o
 OBJS-$(CONFIG_VP9_PARSER)              += vp9_parser.o
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index f6468b54c7..6eb0d70a68 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -35,7 +35,6 @@ 
 #include "vc1data.h"
 #include "wmv2data.h"
 #include "unary.h"
-#include "simple_idct.h"
 
 /***********************************************************************/
 /**
@@ -314,16 +313,6 @@  int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
     v->res_x8          = get_bits1(gb); //reserved
     v->multires        = get_bits1(gb);
     v->res_fasttx      = get_bits1(gb);
-    if (!v->res_fasttx) {
-        v->vc1dsp.vc1_inv_trans_8x8    = ff_simple_idct_int16_8bit;
-        v->vc1dsp.vc1_inv_trans_8x4    = ff_simple_idct84_add;
-        v->vc1dsp.vc1_inv_trans_4x8    = ff_simple_idct48_add;
-        v->vc1dsp.vc1_inv_trans_4x4    = ff_simple_idct44_add;
-        v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_int16_8bit;
-        v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add;
-        v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add;
-        v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add;
-    }
 
     v->fastuvmc        = get_bits1(gb); //common
     if (!v->profile && !v->fastuvmc) {
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index fa6b5cfd3c..2cb39430f5 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -40,6 +40,7 @@ 
 #include "msmpeg4data.h"
 #include "msmpeg4dec.h"
 #include "profiles.h"
+#include "simple_idct.h"
 #include "vc1.h"
 #include "vc1data.h"
 #include "libavutil/avassert.h"
@@ -562,6 +563,14 @@  static av_cold int vc1_decode_init(AVCodecContext *avctx)
         memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64);
         v->left_blk_sh = 3;
         v->top_blk_sh  = 0;
+        v->vc1dsp.vc1_inv_trans_8x8    = ff_simple_idct_int16_8bit;
+        v->vc1dsp.vc1_inv_trans_8x4    = ff_simple_idct84_add;
+        v->vc1dsp.vc1_inv_trans_4x8    = ff_simple_idct48_add;
+        v->vc1dsp.vc1_inv_trans_4x4    = ff_simple_idct44_add;
+        v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_int16_8bit;
+        v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add;
+        v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add;
+        v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add;
     }
 
     if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {