[FFmpeg-cvslog] bfin: Separate VP3 initialization code

Diego Biurrun git at videolan.org
Tue Jan 29 13:55:42 CET 2013


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Mon Jan 28 20:22:54 2013 +0100| [438ea561ade14299f9ea22202a07020870487e09] | committer: Luca Barbato

bfin: Separate VP3 initialization code

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

 libavcodec/bfin/Makefile       |    4 ++--
 libavcodec/bfin/dsputil_bfin.c |    8 +-------
 libavcodec/bfin/dsputil_bfin.h |    3 ---
 libavcodec/bfin/vp3_bfin.c     |    9 ++++++++-
 libavcodec/vp3dsp.c            |    2 ++
 libavcodec/vp3dsp.h            |    1 +
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/libavcodec/bfin/Makefile b/libavcodec/bfin/Makefile
index be81e6c..d1b41bc 100644
--- a/libavcodec/bfin/Makefile
+++ b/libavcodec/bfin/Makefile
@@ -2,7 +2,7 @@ OBJS += bfin/dsputil_bfin.o                                             \
         bfin/fdct_bfin.o                                                \
         bfin/idct_bfin.o                                                \
         bfin/pixels_bfin.o                                              \
-        bfin/vp3_bfin.o                                                 \
-        bfin/vp3_idct_bfin.o                                            \
 
 OBJS-$(CONFIG_MPEGVIDEOENC)             += bfin/mpegvideo_bfin.o
+OBJS-$(CONFIG_VP3DSP)                   += bfin/vp3_bfin.o              \
+                                           bfin/vp3_idct_bfin.o
diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c
index 5d60184..896a3c5 100644
--- a/libavcodec/bfin/dsputil_bfin.c
+++ b/libavcodec/bfin/dsputil_bfin.c
@@ -257,13 +257,7 @@ void ff_dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
         if (avctx->dct_algo == FF_DCT_AUTO)
             c->fdct                  = ff_bfin_fdct;
 
-        // FIXME convert to VP3DSPContext
-        if (0) { // avctx->idct_algo == FF_IDCT_VP3) {
-            c->idct_permutation_type = FF_NO_IDCT_PERM;
-            c->idct                  = ff_bfin_vp3_idct;
-            c->idct_add              = ff_bfin_vp3_idct_add;
-            c->idct_put              = ff_bfin_vp3_idct_put;
-        } else if (avctx->idct_algo == FF_IDCT_AUTO) {
+    if (avctx->idct_algo == FF_IDCT_AUTO) {
             c->idct_permutation_type = FF_NO_IDCT_PERM;
             c->idct                  = ff_bfin_idct;
             c->idct_add              = bfin_idct_add;
diff --git a/libavcodec/bfin/dsputil_bfin.h b/libavcodec/bfin/dsputil_bfin.h
index a7c5863..238c73c 100644
--- a/libavcodec/bfin/dsputil_bfin.h
+++ b/libavcodec/bfin/dsputil_bfin.h
@@ -38,9 +38,6 @@
 
 void ff_bfin_idct (int16_t *block) attribute_l1_text;
 void ff_bfin_fdct (int16_t *block) attribute_l1_text;
-void ff_bfin_vp3_idct (int16_t *block);
-void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block);
-void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block);
 void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
 void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
 void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride)  attribute_l1_text;
diff --git a/libavcodec/bfin/vp3_bfin.c b/libavcodec/bfin/vp3_bfin.c
index 267918c..68c17ee 100644
--- a/libavcodec/bfin/vp3_bfin.c
+++ b/libavcodec/bfin/vp3_bfin.c
@@ -21,8 +21,9 @@
 #include <string.h>
 
 #include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
+#include "libavcodec/vp3dsp.h"
 #include "dsputil_bfin.h"
+#include "vp3_bfin.h"
 
 /* Intra iDCT offset 128 */
 void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block)
@@ -47,3 +48,9 @@ void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block)
 
     memset(block, 0, 128);
 }
+
+void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
+{
+    c->idct_add = ff_bfin_vp3_idct_add;
+    c->idct_put = ff_bfin_vp3_idct_put;
+}
diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c
index f6d2c2a..01649f0 100644
--- a/libavcodec/vp3dsp.c
+++ b/libavcodec/vp3dsp.c
@@ -310,6 +310,8 @@ av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags)
 
     if (ARCH_ARM)
         ff_vp3dsp_init_arm(c, flags);
+    if (ARCH_BFIN)
+        ff_vp3dsp_init_bfin(c, flags);
     if (ARCH_PPC)
         ff_vp3dsp_init_ppc(c, flags);
     if (ARCH_X86)
diff --git a/libavcodec/vp3dsp.h b/libavcodec/vp3dsp.h
index a5e25ec..755271d 100644
--- a/libavcodec/vp3dsp.h
+++ b/libavcodec/vp3dsp.h
@@ -49,6 +49,7 @@ typedef struct VP3DSPContext {
 
 void ff_vp3dsp_init(VP3DSPContext *c, int flags);
 void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags);
+void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags);
 void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags);
 void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags);
 



More information about the ffmpeg-cvslog mailing list