[05/27] vp56: Use hpeldsp instead of dsputil for half-pel functions

Message ID 1365583975-73297-5-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö April 10, 2013, 8:52 a.m.
From: "Ronald S. Bultje" <rsbultje@gmail.com>

This makes vp5 and vp6 independent of dsputil.
---
 configure         |    4 ++--
 libavcodec/vp56.c |    8 ++++----
 libavcodec/vp56.h |    3 ++-
 3 files changed, 8 insertions(+), 7 deletions(-)

Comments

Kostya Shishkov April 10, 2013, 9:14 a.m. | #1
On Wed, Apr 10, 2013 at 11:52:33AM +0300, Martin Storsjö wrote:
> From: "Ronald S. Bultje" <rsbultje@gmail.com>
> 
> This makes vp5 and vp6 independent of dsputil.
> ---
>  configure         |    4 ++--
>  libavcodec/vp56.c |    8 ++++----
>  libavcodec/vp56.h |    3 ++-
>  3 files changed, 8 insertions(+), 7 deletions(-)

looks OK
Diego Biurrun April 10, 2013, 1:47 p.m. | #2
On 04/10/2013 10:52 AM, Martin Storsjö wrote:
> --- a/libavcodec/vp56.c
> +++ b/libavcodec/vp56.c
> @@ -349,7 +349,7 @@ static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
>       } else if (deblock_filtering) {
>           /* only need a 12x12 block, but there is no such dsp function, */
>           /* so copy a 16x12 block */
> -        s->dsp.put_pixels_tab[0][0](s->edge_emu_buffer,
> +        s->hdsp.put_pixels_tab[0][0](s->edge_emu_buffer,
>                                       src + s->block_offset[b] + (dy-2)*stride + (dx-2),
>                                       stride, 12);

indentation

> @@ -419,7 +419,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
>               for (b=0; b<b_max; b++) {
>                   plane = ff_vp56_b2p[b+ab];
>                   off = s->block_offset[b];
> -                s->dsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
> +                s->hdsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
>                                               frame_ref->data[plane] + off,
>                                               s->stride[plane], 8);

indentation

Diego
Martin Storsjö April 10, 2013, 2:31 p.m. | #3
On Wed, 10 Apr 2013, Diego Biurrun wrote:

> On 04/10/2013 10:52 AM, Martin Storsjö wrote:
>> --- a/libavcodec/vp56.c
>> +++ b/libavcodec/vp56.c
>> @@ -349,7 +349,7 @@ static void vp56_mc(VP56Context *s, int b, int plane, 
>> uint8_t *src,
>>       } else if (deblock_filtering) {
>>           /* only need a 12x12 block, but there is no such dsp function, */
>>           /* so copy a 16x12 block */
>> -        s->dsp.put_pixels_tab[0][0](s->edge_emu_buffer,
>> +        s->hdsp.put_pixels_tab[0][0](s->edge_emu_buffer,
>>                                       src + s->block_offset[b] + 
>> (dy-2)*stride + (dx-2),
>>                                       stride, 12);
>
> indentation
>
>> @@ -419,7 +419,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int 
>> col, int is_alpha)
>>               for (b=0; b<b_max; b++) {
>>                   plane = ff_vp56_b2p[b+ab];
>>                   off = s->block_offset[b];
>> -                s->dsp.put_pixels_tab[1][0](frame_current->data[plane] + 
>> off,
>> +                s->hdsp.put_pixels_tab[1][0](frame_current->data[plane] + 
>> off,
>>                                               frame_ref->data[plane] + off,
>>                                               s->stride[plane], 8);
>
> indentation

Both fixed locally

// Martin

Patch

diff --git a/configure b/configure
index b8f0441..a2280ec 100755
--- a/configure
+++ b/configure
@@ -1662,8 +1662,8 @@  vc1image_decoder_select="vc1_decoder"
 vorbis_decoder_select="mdct"
 vorbis_encoder_select="mdct"
 vp3_decoder_select="hpeldsp vp3dsp videodsp"
-vp5_decoder_select="dsputil h264chroma videodsp vp3dsp"
-vp6_decoder_select="dsputil h264chroma huffman videodsp vp3dsp"
+vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
+vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
 vp6a_decoder_select="vp6_decoder"
 vp6f_decoder_select="vp6_decoder"
 vp8_decoder_select="h264pred videodsp"
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 1a83f00..3966076 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -349,7 +349,7 @@  static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
     } else if (deblock_filtering) {
         /* only need a 12x12 block, but there is no such dsp function, */
         /* so copy a 16x12 block */
-        s->dsp.put_pixels_tab[0][0](s->edge_emu_buffer,
+        s->hdsp.put_pixels_tab[0][0](s->edge_emu_buffer,
                                     src + s->block_offset[b] + (dy-2)*stride + (dx-2),
                                     stride, 12);
         src_block = s->edge_emu_buffer;
@@ -376,7 +376,7 @@  static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
                                            src_block+src_offset+overlap_offset,
                                            stride, 8);
     } else {
-        s->dsp.put_pixels_tab[1][0](dst, src_block+src_offset, stride, 8);
+        s->hdsp.put_pixels_tab[1][0](dst, src_block+src_offset, stride, 8);
     }
 }
 
@@ -419,7 +419,7 @@  static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
             for (b=0; b<b_max; b++) {
                 plane = ff_vp56_b2p[b+ab];
                 off = s->block_offset[b];
-                s->dsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
+                s->hdsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
                                             frame_ref->data[plane] + off,
                                             s->stride[plane], 8);
                 s->vp3dsp.idct_add(frame_current->data[plane] + off,
@@ -656,8 +656,8 @@  av_cold int ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
     s->avctx = avctx;
     avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
 
-    ff_dsputil_init(&s->dsp, avctx);
     ff_h264chroma_init(&s->h264chroma, 8);
+    ff_hpeldsp_init(&s->hdsp, avctx->flags);
     ff_videodsp_init(&s->vdsp, 8);
     ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
     ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h
index 7fe6cf3..553a625 100644
--- a/libavcodec/vp56.h
+++ b/libavcodec/vp56.h
@@ -29,6 +29,7 @@ 
 #include "vp56data.h"
 #include "dsputil.h"
 #include "get_bits.h"
+#include "hpeldsp.h"
 #include "bytestream.h"
 #include "h264chroma.h"
 #include "videodsp.h"
@@ -95,8 +96,8 @@  typedef struct VP56Model {
 
 struct vp56_context {
     AVCodecContext *avctx;
-    DSPContext dsp;
     H264ChromaContext h264chroma;
+    HpelDSPContext hdsp;
     VideoDSPContext vdsp;
     VP3DSPContext vp3dsp;
     VP56DSPContext vp56dsp;