]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo.c
Altivec version of avg_no_rnd_vc1_chroma_mc8
[ffmpeg] / libavcodec / mpegvideo.c
index 9602604b35ad0626d522e3ad66c5c676f789eec7..67b16dcda6a4c3eae7f40e379ffa86a192e1acff 100644 (file)
@@ -81,6 +81,7 @@ const enum PixelFormat ff_pixfmt_list_420[] = {
 };
 
 const enum PixelFormat ff_hwaccel_pixfmt_list_420[] = {
+    PIX_FMT_VAAPI_VLD,
     PIX_FMT_YUV420P,
     PIX_FMT_NONE
 };
@@ -170,7 +171,7 @@ void ff_copy_picture(Picture *dst, Picture *src){
 static void free_frame_buffer(MpegEncContext *s, Picture *pic)
 {
     s->avctx->release_buffer(s->avctx, (AVFrame*)pic);
-    av_freep(&pic->hwaccel_data_private);
+    av_freep(&pic->hwaccel_picture_private);
 }
 
 /**
@@ -181,10 +182,10 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
     int r;
 
     if (s->avctx->hwaccel) {
-        assert(!pic->hwaccel_data_private);
+        assert(!pic->hwaccel_picture_private);
         if (s->avctx->hwaccel->priv_data_size) {
-            pic->hwaccel_data_private = av_malloc(s->avctx->hwaccel->priv_data_size);
-            if (!pic->hwaccel_data_private) {
+            pic->hwaccel_picture_private = av_mallocz(s->avctx->hwaccel->priv_data_size);
+            if (!pic->hwaccel_picture_private) {
                 av_log(s->avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n");
                 return -1;
             }
@@ -195,7 +196,7 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
 
     if (r<0 || !pic->age || !pic->type || !pic->data[0]) {
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %d %d %p)\n", r, pic->age, pic->type, pic->data[0]);
-        av_freep(&pic->hwaccel_data_private);
+        av_freep(&pic->hwaccel_picture_private);
         return -1;
     }
 
@@ -443,7 +444,10 @@ av_cold int MPV_common_init(MpegEncContext *s)
 {
     int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y, threads;
 
-    s->mb_height = (s->height + 15) / 16;
+    if(s->codec_id == CODEC_ID_MPEG2VIDEO && !s->progressive_sequence)
+        s->mb_height = (s->height + 31) / 32 * 2;
+    else
+        s->mb_height = (s->height + 15) / 16;
 
     if(s->avctx->pix_fmt == PIX_FMT_NONE){
         av_log(s->avctx, AV_LOG_ERROR, "decoding to PIX_FMT_NONE is not supported.\n");