summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 3960b042f..45ef0235a 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -1711,6 +1711,25 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *bu
}
}
+static void ff_postprocess (ff_video_decoder_t *this, vo_frame_t *img)
+{
+#ifdef AV_BUFFER
+ int qstride, qtype;
+ int8_t *qtable;
+#if LIBAVUTIL_VERSION_MAJOR < 53
+ qtable = av_frame_get_qp_table (this->av_frame, &qstride, &qtype);
+#else
+ qtable = this->av_frame->qscale_table;
+ qstride = this->av_frame->qstride;
+ qtype = this->av_frame->qscale_type;
+#endif
+#endif
+ pp_postprocess ((const uint8_t **)this->av_frame->data, this->av_frame->linesize,
+ img->base, img->pitches, this->bih.biWidth, this->bih.biHeight,
+ qtable, qstride, this->our_mode, this->our_context,
+ this->av_frame->pict_type | (qtype ? PP_PICT_TYPE_QP2 : 0));
+}
+
static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
uint8_t *chunk_buf = this->buf;
AVRational avr00 = {0, 1};
@@ -1980,24 +1999,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
img->crop_bottom = img->height - this->bih.biHeight;
free_img = 1;
}
-#ifdef AV_BUFFER
- {
- int qstride, qtype;
- int8_t *qtable = av_frame_get_qp_table (this->av_frame, &qstride, &qtype);
-
- pp_postprocess ((const uint8_t **)this->av_frame->data, this->av_frame->linesize,
- img->base, img->pitches, this->bih.biWidth, this->bih.biHeight,
- qtable, qstride, this->our_mode, this->our_context,
- this->av_frame->pict_type | (qtype ? PP_PICT_TYPE_QP2 : 0));
- }
-#else
- pp_postprocess((const uint8_t **)this->av_frame->data, this->av_frame->linesize,
- img->base, img->pitches,
- this->bih.biWidth, this->bih.biHeight,
- this->av_frame->qscale_table, this->av_frame->qstride,
- this->our_mode, this->our_context,
- this->av_frame->pict_type);
-#endif
+ ff_postprocess (this, img);
} else if (!this->av_frame->opaque) {
/* colorspace conversion or copy */
if( this->context->pix_fmt != PIX_FMT_VAAPI_VLD)
@@ -2230,22 +2232,7 @@ static void ff_flush_internal (ff_video_decoder_t *this, int display) {
img->crop_bottom = img->height - this->bih.biHeight;
free_img = 1;
}
-#ifdef AV_BUFFER
- {
- int qstride, qtype;
- int8_t *qtable = av_frame_get_qp_table (this->av_frame, &qstride, &qtype);
-
- pp_postprocess ((const uint8_t **)this->av_frame->data, this->av_frame->linesize,
- img->base, img->pitches, this->bih.biWidth, this->bih.biHeight,
- qtable, qstride, this->our_mode, this->our_context,
- this->av_frame->pict_type | (qtype ? PP_PICT_TYPE_QP2 : 0));
- }
-#else
- pp_postprocess ((const uint8_t **)this->av_frame->data, this->av_frame->linesize,
- img->base, img->pitches, this->bih.biWidth, this->bih.biHeight,
- this->av_frame->qscale_table, this->av_frame->qstride,
- this->our_mode, this->our_context, this->av_frame->pict_type);
-#endif
+ ff_postprocess (this, img);
} else if (!this->av_frame->opaque) {
/* colorspace conversion or copy */
if (this->context->pix_fmt != PIX_FMT_VAAPI_VLD)