]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/snow.c
Merge commit '8d26c193fb42d08602ac93ece039d4718d029adc'
[ffmpeg] / libavcodec / snow.c
index 101c8f83e5c19e0cb98304ba00a48ff05b41db05..33a2dbc12973429aa7f0db3d4596d1275233061c 100644 (file)
@@ -535,8 +535,8 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
         int h= s->avctx->height;
 
         if(plane_index){
-            w>>= s->chroma_h_shift;
-            h>>= s->chroma_v_shift;
+            w = FF_CEIL_RSHIFT(w, s->chroma_h_shift);
+            h = FF_CEIL_RSHIFT(h, s->chroma_v_shift);
         }
         s->plane[plane_index].width = w;
         s->plane[plane_index].height= h;
@@ -590,8 +590,8 @@ static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *fra
 
     for(p=0; p < s->nb_planes; p++){
         int is_chroma= !!p;
-        int w= is_chroma ? s->avctx->width >>s->chroma_h_shift : s->avctx->width;
-        int h= is_chroma ? s->avctx->height>>s->chroma_v_shift : s->avctx->height;
+        int w= is_chroma ? FF_CEIL_RSHIFT(s->avctx->width,  s->chroma_h_shift) : s->avctx->width;
+        int h= is_chroma ? FF_CEIL_RSHIFT(s->avctx->height, s->chroma_v_shift) : s->avctx->height;
         int ls= frame->linesize[p];
         uint8_t *src= frame->data[p];