From: Derek Buitenhuis Date: Wed, 27 Apr 2016 15:52:02 +0000 (+0100) Subject: Merge commit '549fc77273636d0d02175362af5dcd60c79f7633' X-Git-Tag: android-x86-7.1-r1~5451 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6f784c158bd56f2cc73354974ceebb04a40e0f52;p=android-x86%2Fexternal-ffmpeg.git Merge commit '549fc77273636d0d02175362af5dcd60c79f7633' * commit '549fc77273636d0d02175362af5dcd60c79f7633': svq3: move mb2br_xy to the SVQ3Context Merged-by: Derek Buitenhuis --- 6f784c158bd56f2cc73354974ceebb04a40e0f52 diff --cc libavcodec/svq3.c index 6ae67c2a82,8c56995219..b483eb04b6 --- a/libavcodec/svq3.c +++ b/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; + 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 (ff_h264_alloc_tables(h) < 0) { + 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;