+ sd_in = av_frame_get_side_data(in, AV_FRAME_DATA_VIDEO_ENC_PARAMS);
+ if (sd_in && sd_in->size >= sizeof(AVVideoEncParams)) {
+ par_in = (AVVideoEncParams*)sd_in->data;
+
+ // we accept the input QP table only if it is of the MPEG2 type
+ // and contains either no blocks at all or 16x16 macroblocks
+ if (par_in->type == AV_VIDEO_ENC_PARAMS_MPEG2 &&
+ (par_in->nb_blocks == s->h * s->qstride || !par_in->nb_blocks)) {
+ in_qp_global = par_in->qp;
+ if (!par_in->nb_blocks)
+ par_in = NULL;
+ } else
+ par_in = NULL;