Skip to content
Snippets Groups Projects
Commit bb145c59 authored by Eloi Bail's avatar Eloi Bail Committed by gerrit2
Browse files

media/video: remove workaround for h263p

This commit adds a patch from libav resolving issues with h263p encoder.
see https://bugzilla.libav.org/show_bug.cgi?id=912

Change-Id: I95f5e81063af01a57be47b70fadaf54c3393eb52
Tuleap: #138
parent f4ea2860
Branches
Tags
No related merge requests found
From f6c94457b44f41d900cd0991857f54e1f0ccedd6 Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Wed, 18 Nov 2015 10:37:16 +0100
Subject: [PATCH] mpegvideo_enc: enable rtp_mode when multiple slices are used
Currently, multiple slices with just one thread produce corrupted
output.
Additionally, enable slice structured mode for h263(+)
Bug-Id: 912
CC: libav-stabl@libav.org
---
libavcodec/mpegvideo_enc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index d572b85..b915741 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -519,9 +519,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
return -1;
}
- if (s->avctx->thread_count > 1)
- s->rtp_mode = 1;
-
if (!avctx->time_base.den || !avctx->time_base.num) {
av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
return -1;
@@ -764,6 +761,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
if ((CONFIG_H263P_ENCODER || CONFIG_RV20_ENCODER) && s->modified_quant)
s->chroma_qscale_table = ff_h263_chroma_qscale_table;
+ if (s->slice_context_count > 1) {
+ s->rtp_mode = 1;
+
+ if (avctx->codec_id == AV_CODEC_ID_H263 || avctx->codec_id == AV_CODEC_ID_H263P)
+ s->h263_slice_structured = 1;
+ }
+
s->quant_precision = 5;
ff_set_cmp(&s->mecc, s->mecc.ildct_cmp, s->avctx->ildct_cmp);
--
2.1.4
......@@ -186,6 +186,7 @@ libav: libav-$(LIBAV_HASH).tar.xz .sum-libav
$(APPLY) $(SRC)/libav/0001-rtpdec-add-a-trace-when-jitter-buffer-is-full.patch
$(APPLY) $(SRC)/libav/0002-rtpdec-inform-jitter-buffer-size.patch
$(APPLY) $(SRC)/libav/0003-rtsp-warning-when-max_delay-reached.patch
$(APPLY) $(SRC)/libav/0004-mpegvideo_enc-enable-rtp_mode-when-multiple-slices-a.patch
$(MOVE)
.libav: libav
......
......@@ -201,10 +201,6 @@ MediaEncoder::openOutput(const char *filename,
} else if (args.codec->systemCodecInfo.avcodecId == AV_CODEC_ID_H263) {
encoderCtx_->bit_rate = encoderCtx_->rc_max_rate = maxBitrate;
encoderCtx_->rc_buffer_size = maxBitrate;
// on libav there are video artifcats if multithreading is enabled
// see https://bugzilla.libav.org/show_bug.cgi?id=912
// TODO: this is a workaround !
encoderCtx_->thread_count = 1;
RING_DBG("Using Max bitrate %d", maxBitrate);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment