On Sun, Aug 28, 2016 at 10:47 PM, Michael Niedermayer < mich...@niedermayer.cc> wrote:
> On Sun, Aug 28, 2016 at 06:24:14PM +0000, Davinder Singh wrote: > > hi, > > > > this rename confusing chroma variables to one used in AVPixFmtDescriptor. > > more consistent. > > also removed some useless vars from context. > > > > thanks > > DSM_ > > [...] > > > @@ -900,6 +894,8 @@ static void bidirectional_obmc(MIContext *mi_ctx, > int alpha) > > } > > } > > > > + > > + > > static void set_frame_data(MIContext *mi_ctx, int alpha, AVFrame > *avf_out) > > { > > int x, y, plane; > > stray change > > > > @@ -936,8 +932,8 @@ static void set_frame_data(MIContext *mi_ctx, int > alpha, AVFrame *avf_out) > > for (i = 0; i < pixel->nb; i++) { > > Frame *frame = &mi_ctx->frames[pixel->refs[i]]; > > if (chroma) { > > - x_mv = (x >> mi_ctx->chroma_h_shift) + > (pixel->mvs[i][0] >> mi_ctx->chroma_h_shift); > > - y_mv = (y >> mi_ctx->chroma_v_shift) + > (pixel->mvs[i][1] >> mi_ctx->chroma_v_shift); > > + x_mv = (x >> mi_ctx->log2_chroma_w) + > (pixel->mvs[i][0] >> mi_ctx->log2_chroma_w); > > + y_mv = (y >> mi_ctx->log2_chroma_h) + > (pixel->mvs[i][1] >> mi_ctx->log2_chroma_h); > > } else { > > x_mv = x + pixel->mvs[i][0]; > > y_mv = y + pixel->mvs[i][1]; > > @@ -949,7 +945,7 @@ static void set_frame_data(MIContext *mi_ctx, int > alpha, AVFrame *avf_out) > > val = ROUNDED_DIV(val, weight_sum); > > > > if (chroma) > > - avf_out->data[plane][(x >> mi_ctx->chroma_h_shift) > + (y >> mi_ctx->chroma_v_shift) * avf_out->linesize[plane]] = val; > > + avf_out->data[plane][(x >> mi_ctx->log2_chroma_w) + > (y >> mi_ctx->log2_chroma_h) * avf_out->linesize[plane]] = val; > > else > > avf_out->data[plane][x + y * > avf_out->linesize[plane]] = val; > > } > > @@ -1092,8 +1088,8 @@ static void interpolate(AVFilterLink *inlink, > AVFrame *avf_out) > > int height = avf_out->height; > > > > if (plane == 1 || plane == 2) { > > - width = mi_ctx->chroma_width; > > - height = mi_ctx->chroma_height; > > + width = width >> mi_ctx->log2_chroma_w; > > + height = height >> mi_ctx->log2_chroma_h; > > this is rounded differntly if wdith / height is odd, > is that intended ? > It should use AV_CEIL_RSHIFT _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel