]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/motionpixels.c
vc-1: Optimise parser (with special attention to ARM)
[ffmpeg] / libavcodec / motionpixels.c
index 089909a4d8a94a36a37b729485f3c5055387fc88..13d4759ae6b6e7abc77e97a293719e553d7a0705 100644 (file)
@@ -77,10 +77,10 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
     motionpixels_tableinit();
     mp->avctx = avctx;
     ff_dsputil_init(&mp->dsp, avctx);
-    mp->changes_map = av_mallocz(avctx->width * h4);
+    mp->changes_map = av_mallocz_array(avctx->width, h4);
     mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
-    mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
-    mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
+    mp->vpt = av_mallocz_array(avctx->height, sizeof(YuvPixel));
+    mp->hpt = av_mallocz_array(h4 / 4, w4 / 4 * sizeof(YuvPixel));
     if (!mp->changes_map || !mp->vpt || !mp->hpt) {
         av_freep(&mp->changes_map);
         av_freep(&mp->vpt);