[FFmpeg-cvslog] Merge commit '8eecae77ff6e2923de57dd883421d24fd53ca61f'

Derek Buitenhuis git at videolan.org
Wed Apr 27 17:50:13 CEST 2016


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Wed Apr 27 16:47:52 2016 +0100| [fed686af232487dad6ec46294b3e5018f11943f1] | committer: Derek Buitenhuis

Merge commit '8eecae77ff6e2923de57dd883421d24fd53ca61f'

* commit '8eecae77ff6e2923de57dd883421d24fd53ca61f':
  svq3: move edge_emu_buffer to the SVQ3Context

Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

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

 libavcodec/svq3.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 93539fa..d5ed692 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -106,6 +106,8 @@ typedef struct SVQ3Context {
     unsigned int top_samples_available;
     unsigned int topright_samples_available;
     unsigned int left_samples_available;
+
+    uint8_t *edge_emu_buffer;
 } SVQ3Context;
 
 #define FULLPEL_MODE  1
@@ -343,11 +345,11 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
     src  = pic->f->data[0] + mx + my * sl->linesize;
 
     if (emu) {
-        s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src,
+        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
                                  sl->linesize, sl->linesize,
                                  width + 1, height + 1,
                                  mx, my, s->h_edge_pos, s->v_edge_pos);
-        src = sl->edge_emu_buffer;
+        src = s->edge_emu_buffer;
     }
     if (thirdpel)
         (avg ? s->tdsp.avg_tpel_pixels_tab
@@ -370,12 +372,12 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
             src  = pic->f->data[i] + mx + my * sl->uvlinesize;
 
             if (emu) {
-                s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src,
+                s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
                                          sl->uvlinesize, sl->uvlinesize,
                                          width + 1, height + 1,
                                          mx, my, (s->h_edge_pos >> 1),
                                          s->v_edge_pos >> 1);
-                src = sl->edge_emu_buffer;
+                src = s->edge_emu_buffer;
             }
             if (thirdpel)
                 (avg ? s->tdsp.avg_tpel_pixels_tab
@@ -1290,9 +1292,9 @@ static int get_buffer(AVCodecContext *avctx, H264Picture *pic)
     if (ret < 0)
         goto fail;
 
-    if (!sl->edge_emu_buffer) {
-        sl->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17);
-        if (!sl->edge_emu_buffer)
+    if (!s->edge_emu_buffer) {
+        s->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17);
+        if (!s->edge_emu_buffer)
             return AVERROR(ENOMEM);
     }
 
@@ -1542,6 +1544,7 @@ static av_cold int svq3_decode_end(AVCodecContext *avctx)
     av_freep(&s->last_pic);
     av_freep(&s->slice_buf);
     av_freep(&s->intra4x4_pred_mode);
+    av_freep(&s->edge_emu_buffer);
 
     memset(&h->cur_pic, 0, sizeof(h->cur_pic));
 


======================================================================

diff --cc libavcodec/svq3.c
index 93539fa,5564d29..d5ed692
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@@ -1290,9 -1266,9 +1292,9 @@@ static int get_buffer(AVCodecContext *a
      if (ret < 0)
          goto fail;
  
-     if (!sl->edge_emu_buffer) {
-         sl->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17);
-         if (!sl->edge_emu_buffer)
+     if (!s->edge_emu_buffer) {
 -        s->edge_emu_buffer = av_mallocz(pic->f->linesize[0] * 17);
++        s->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17);
+         if (!s->edge_emu_buffer)
              return AVERROR(ENOMEM);
      }
  



More information about the ffmpeg-cvslog mailing list