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;
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];