OSDN Git Service

Merge commit '549fc77273636d0d02175362af5dcd60c79f7633'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 27 Apr 2016 15:52:02 +0000 (16:52 +0100)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 27 Apr 2016 15:52:02 +0000 (16:52 +0100)
* commit '549fc77273636d0d02175362af5dcd60c79f7633':
  svq3: move mb2br_xy to the SVQ3Context

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
libavcodec/svq3.c

@@@ -1304,9 -1279,25 +1306,25 @@@ static av_cold int svq3_decode_init(AVC
      s->h_edge_pos = h->mb_width * 16;
      s->v_edge_pos = h->mb_height * 16;
  
 -    if (ff_h264_alloc_tables(h) < 0) {
+     s->intra4x4_pred_mode = av_mallocz(h->mb_stride * 2 * 8);
+     if (!s->intra4x4_pred_mode)
+         return AVERROR(ENOMEM);
+     s->mb2br_xy = av_mallocz(h->mb_stride * (h->mb_height + 1) *
+                              sizeof(*s->mb2br_xy));
+     if (!s->mb2br_xy)
+         return AVERROR(ENOMEM);
+     for (y = 0; y < h->mb_height; y++)
+         for (x = 0; x < h->mb_width; x++) {
+             const int mb_xy = x + y * h->mb_stride;
+             s->mb2br_xy[mb_xy] = 8 * (mb_xy % (2 * h->mb_stride));
+         }
 +    if ((ret = ff_h264_alloc_tables(h)) < 0) {
          av_log(avctx, AV_LOG_ERROR, "svq3 memory allocation failed\n");
 -        return AVERROR(ENOMEM);
 +        goto fail;
      }
  
      return 0;