mirror of https://github.com/sipwise/jitsi.git
Update ffmpeg/x264 which provide amongs the other periodic intra refresh feature (instead of a big keyframe, the keyframe is spread over many frames). It provides also resilience to packet loss.
parent
81c23e6cd0
commit
7ff79a95ef
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,73 @@
|
||||
Index: libavcodec/libx264.c
|
||||
===================================================================
|
||||
--- libavcodec/libx264.c (revision 23181)
|
||||
+++ libavcodec/libx264.c (working copy)
|
||||
@@ -99,15 +99,17 @@
|
||||
}
|
||||
|
||||
x4->pic.i_pts = frame->pts;
|
||||
- x4->pic.i_type = X264_TYPE_AUTO;
|
||||
+ x4->pic.i_type = frame->key_frame ? X264_TYPE_IDR : X264_TYPE_AUTO;
|
||||
}
|
||||
|
||||
+ do {
|
||||
if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
|
||||
return -1;
|
||||
|
||||
bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0);
|
||||
if (bufsize < 0)
|
||||
return -1;
|
||||
+ } while(!bufsize && !frame && x264_encoder_delayed_frames(x4->enc));
|
||||
|
||||
/* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */
|
||||
x4->out_pic.pts = pic_out.i_pts;
|
||||
@@ -156,7 +158,7 @@
|
||||
x4->params.p_log_private = avctx;
|
||||
|
||||
x4->params.i_keyint_max = avctx->gop_size;
|
||||
- x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH;
|
||||
+ x4->params.b_intra_refresh = 1; /* avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH; */
|
||||
x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
|
||||
x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
|
||||
x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
|
||||
@@ -173,7 +175,7 @@
|
||||
x4->params.rc.i_qp_constant = avctx->cqp;
|
||||
}
|
||||
}
|
||||
-
|
||||
+
|
||||
// if neither crf nor cqp modes are selected we have to enable the RC
|
||||
// we do it this way because we cannot check if the bitrate has been set
|
||||
if (!(avctx->crf || (avctx->cqp > -1)))
|
||||
@@ -186,7 +188,7 @@
|
||||
x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
|
||||
avctx->has_b_frames = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames;
|
||||
|
||||
- x4->params.i_keyint_min = avctx->keyint_min;
|
||||
+ x4->params.i_keyint_min = 0; /* avctx->keyint_min; */
|
||||
if (x4->params.i_keyint_min > x4->params.i_keyint_max)
|
||||
x4->params.i_keyint_min = x4->params.i_keyint_max;
|
||||
|
||||
@@ -293,6 +295,13 @@
|
||||
|
||||
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
|
||||
x4->params.b_repeat_headers = 0;
|
||||
+
|
||||
+ /* zero latency */
|
||||
+ x4->params.rc.i_lookahead = 0;
|
||||
+ x4->params.i_sync_lookahead = 0;
|
||||
+ x4->params.i_bframe = 0;
|
||||
+ x4->params.b_sliced_threads = 1;
|
||||
+ x4->params.b_vfr_input = 0;
|
||||
|
||||
x4->enc = x264_encoder_open(&x4->params);
|
||||
if (!x4->enc)
|
||||
@@ -313,7 +322,7 @@
|
||||
avctx->extradata = av_malloc(s);
|
||||
avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1);
|
||||
}
|
||||
-
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
Index: libavcodec/libx264.c
|
||||
===================================================================
|
||||
--- libavcodec/libx264.c (révision 20783)
|
||||
+++ libavcodec/libx264.c (copie de travail)
|
||||
@@ -99,7 +99,7 @@
|
||||
}
|
||||
|
||||
x4->pic.i_pts = frame->pts;
|
||||
- x4->pic.i_type = X264_TYPE_AUTO;
|
||||
+ x4->pic.i_type = frame->key_frame ? X264_TYPE_IDR : X264_TYPE_AUTO;
|
||||
}
|
||||
|
||||
if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
|
||||
@ -0,0 +1,22 @@
|
||||
Index: libswscale/swscale_template.c
|
||||
===================================================================
|
||||
--- libswscale/swscale_template.c (révision 31187)
|
||||
+++ libswscale/swscale_template.c (copie de travail)
|
||||
@@ -2252,7 +2252,7 @@
|
||||
"shrl $9, %%esi \n\t" \
|
||||
|
||||
static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
||||
- long dstWidth, const uint8_t *src, int srcW,
|
||||
+ x86_reg dstWidth, const uint8_t *src, int srcW,
|
||||
int xInc)
|
||||
{
|
||||
#if ARCH_X86
|
||||
@@ -2401,7 +2401,7 @@
|
||||
}
|
||||
|
||||
static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst,
|
||||
- long dstWidth, const uint8_t *src1,
|
||||
+ x86_reg dstWidth, const uint8_t *src1,
|
||||
const uint8_t *src2, int srcW, int xInc)
|
||||
{
|
||||
#if ARCH_X86
|
||||
Loading…
Reference in new issue