[FFmpeg-cvslog] mpeg12: Ignore slice threading if hwaccel is active
Rémi Denis-Courmont
git at videolan.org
Fri Jul 26 12:34:07 CEST 2013
ffmpeg | branch: release/2.0 | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 24 19:50:43 2013 +0300| [ccf470fdb6e3608fbef431e48af7e22266298471] | committer: Carl Eugen Hoyos
mpeg12: Ignore slice threading if hwaccel is active
Slice threading does not work with hardware acceleration, as decoding
is per-picture. This fixes Bugzilla #542.
Signed-off-by: Diego Biurrun <diego at biurrun.de>
(cherry picked from commit 93a51984a27f3ba84d4e6f13d0c704ee9891603e)
Conflicts:
libavcodec/mpeg12dec.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ccf470fdb6e3608fbef431e48af7e22266298471
---
libavcodec/mpeg12dec.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 447057a..7510da4 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2130,7 +2130,8 @@ static int decode_chunks(AVCodecContext *avctx,
buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code);
if (start_code > 0x1ff) {
if (!skip_frame) {
- if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
+ if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
+ !avctx->hwaccel) {
int i;
av_assert0(avctx->thread_count > 1);
@@ -2194,7 +2195,8 @@ static int decode_chunks(AVCodecContext *avctx,
s2->intra_dc_precision= 3;
s2->intra_matrix[0]= 1;
}
- if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && s->slice_count) {
+ if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
+ !avctx->hwaccel && s->slice_count) {
int i;
avctx->execute(avctx, slice_decode_thread,
@@ -2369,7 +2371,8 @@ static int decode_chunks(AVCodecContext *avctx,
break;
}
- if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
+ if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
+ !avctx->hwaccel) {
int threshold = (s2->mb_height * s->slice_count +
s2->slice_context_count / 2) /
s2->slice_context_count;
More information about the ffmpeg-cvslog
mailing list