Merge commit '57f09608e1600d1cf1679885a46f5004d522d68f'
[ffmpeg.git] / libavcodec / svq3.c
index 01a2e6a..bf8c688 100644 (file)
@@ -54,6 +54,7 @@
 #include "golomb.h"
 #include "hpeldsp.h"
 #include "rectangle.h"
+#include "tpeldsp.h"
 #include "vdpau_internal.h"
 
 #if CONFIG_ZLIB
@@ -71,6 +72,7 @@
 typedef struct {
     H264Context h;
     HpelDSPContext hdsp;
+    TpelDSPContext tdsp;
     H264Picture *cur_pic;
     H264Picture *next_pic;
     H264Picture *last_pic;
@@ -328,9 +330,9 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
         src = h->edge_emu_buffer;
     }
     if (thirdpel)
-        (avg ? h->dsp.avg_tpel_pixels_tab
-             : h->dsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
-                                                width, height);
+        (avg ? s->tdsp.avg_tpel_pixels_tab
+             : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
+                                                 width, height);
     else
         (avg ? s->hdsp.avg_pixels_tab
              : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, h->linesize,
@@ -356,10 +358,10 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
                 src = h->edge_emu_buffer;
             }
             if (thirdpel)
-                (avg ? h->dsp.avg_tpel_pixels_tab
-                     : h->dsp.put_tpel_pixels_tab)[dxy](dest, src,
-                                                        h->uvlinesize,
-                                                        width, height);
+                (avg ? s->tdsp.avg_tpel_pixels_tab
+                     : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src,
+                                                         h->uvlinesize,
+                                                         width, height);
             else
                 (avg ? s->hdsp.avg_pixels_tab
                      : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src,
@@ -887,6 +889,8 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
         goto fail;
 
     ff_hpeldsp_init(&s->hdsp, avctx->flags);
+    ff_tpeldsp_init(&s->tdsp);
+
     h->flags           = avctx->flags;
     h->is_complex      = 1;
     h->sps.chroma_format_idc = 1;