int i, level, nCoeffs;
const uint16_t *quant_matrix;
+ if (s->q_scale_type) qscale = ff_mpeg2_non_linear_qscale[qscale];
+ else qscale <<= 1;
+
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
if (level) {
if (level < 0) {
level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = (int)(level * qscale * quant_matrix[j]) >> 4;
level = -level;
} else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = (int)(level * qscale * quant_matrix[j]) >> 4;
}
block[j] = level;
}
const uint16_t *quant_matrix;
int sum=-1;
+ if (s->q_scale_type) qscale = ff_mpeg2_non_linear_qscale[qscale];
+ else qscale <<= 1;
+
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
if (level) {
if (level < 0) {
level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = (int)(level * qscale * quant_matrix[j]) >> 4;
level = -level;
} else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
+ level = (int)(level * qscale * quant_matrix[j]) >> 4;
}
block[j] = level;
sum+=level;
const uint16_t *quant_matrix;
int sum=-1;
+ if (s->q_scale_type) qscale = ff_mpeg2_non_linear_qscale[qscale];
+ else qscale <<= 1;
+
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
if (level < 0) {
level = -level;
level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
+ ((int) (quant_matrix[j]))) >> 5;
level = -level;
} else {
level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
+ ((int) (quant_matrix[j]))) >> 5;
}
block[j] = level;
sum+=level;
if (&s->picture[i] != s->last_picture_ptr &&
&s->picture[i] != s->next_picture_ptr &&
s->picture[i].reference && !s->picture[i].needs_realloc) {
- if (!(avctx->active_thread_type & FF_THREAD_FRAME))
- av_log(avctx, AV_LOG_ERROR,
- "releasing zombie picture\n");
ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
}
}
return -1;
}
- if (!avctx->hwaccel && !(avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)) {
+ if (!avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ && !(avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ ) {
for(i=0; i<avctx->height; i++)
memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
0x80, avctx->width);
/* TODO: export all the following to make them accessible for users (and filters) */
if (avctx->hwaccel || !mbtype_table
- || (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU))
+#if FF_API_CAP_VDPAU
+ || (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ )
return;