Browse code

svq1enc: Use hpeldsp instead of dsputil for half-pel functions

Signed-off-by: Martin Storsjö <martin@martin.st>

Ronald S. Bultje authored on 2013/03/11 06:16:00
Showing 2 changed files
... ...
@@ -1641,7 +1641,7 @@ shorten_decoder_select="golomb"
1641 1641
 sipr_decoder_select="lsp"
1642 1642
 sp5x_decoder_select="dsputil"
1643 1643
 svq1_decoder_select="hpeldsp"
1644
-svq1_encoder_select="aandcttables dsputil mpegvideoenc"
1644
+svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
1645 1645
 svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp"
1646 1646
 svq3_decoder_suggest="error_resilience zlib"
1647 1647
 tak_decoder_select="dsputil"
... ...
@@ -27,6 +27,8 @@
27 27
  */
28 28
 
29 29
 #include "avcodec.h"
30
+#include "dsputil.h"
31
+#include "hpeldsp.h"
30 32
 #include "mpegvideo.h"
31 33
 #include "h263.h"
32 34
 #include "internal.h"
... ...
@@ -43,6 +45,7 @@ typedef struct SVQ1Context {
43 43
     MpegEncContext m;
44 44
     AVCodecContext *avctx;
45 45
     DSPContext dsp;
46
+    HpelDSPContext hdsp;
46 47
     AVFrame picture;
47 48
     AVFrame current_picture;
48 49
     AVFrame last_picture;
... ...
@@ -444,10 +447,10 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
444 444
 
445 445
                     dxy = (mx & 1) + 2 * (my & 1);
446 446
 
447
-                    s->dsp.put_pixels_tab[0][dxy](temp + 16,
448
-                                                  ref + (mx >> 1) +
449
-                                                  stride * (my >> 1),
450
-                                                  stride, 16);
447
+                    s->hdsp.put_pixels_tab[0][dxy](temp + 16,
448
+                                                   ref + (mx >> 1) +
449
+                                                   stride * (my >> 1),
450
+                                                   stride, 16);
451 451
 
452 452
                     score[1] += encode_block(s, src + 16 * x, temp + 16,
453 453
                                              decoded, stride, 5, 64, lambda, 0);
... ...
@@ -459,7 +462,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
459 459
                     score[2] += vlc[1] * lambda;
460 460
                     if (score[2] < score[best] && mx == 0 && my == 0) {
461 461
                         best = 2;
462
-                        s->dsp.put_pixels_tab[0][0](decoded, ref, stride, 16);
462
+                        s->hdsp.put_pixels_tab[0][0](decoded, ref, stride, 16);
463 463
                         for (i = 0; i < 6; i++)
464 464
                             count[2][i] = 0;
465 465
                         put_bits(&s->pb, vlc[1], vlc[0]);
... ...
@@ -489,7 +492,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
489 489
                 avpriv_copy_bits(&s->pb, reorder_buffer[best][i],
490 490
                                  count[best][i]);
491 491
             if (best == 0)
492
-                s->dsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
492
+                s->hdsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
493 493
         }
494 494
         s->m.first_slice_line = 0;
495 495
     }
... ...
@@ -501,6 +504,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
501 501
     SVQ1Context *const s = avctx->priv_data;
502 502
 
503 503
     ff_dsputil_init(&s->dsp, avctx);
504
+    ff_hpeldsp_init(&s->hdsp, avctx->flags);
504 505
     avctx->coded_frame = &s->picture;
505 506
 
506 507
     s->frame_width  = avctx->width;