libquicktime/libquicktime-1.1.3-x264.patch

102 lines
3.3 KiB
Diff

Upstream status: Mailed to libquicktime-devel@sf mailing list on 26/10/2009
Merged on 27/10/2009
Index: plugins/x264/lqt_x264.c
===================================================================
RCS file: /cvsroot/libquicktime/libquicktime/plugins/x264/lqt_x264.c,v
retrieving revision 1.13
diff -u -B -r1.13 lqt_x264.c
--- plugins/x264/lqt_x264.c 6 Dec 2008 14:03:10 -0000 1.13
+++ plugins/x264/lqt_x264.c 26 Oct 2009 11:02:55 -0000
@@ -94,6 +94,17 @@
.val_max = { .val_int = 100 },
.help_string = TRS("Influences how often B-frames are used"),
},
+#if X264_BUILD >= 78
+ {
+ .name = "x264_i_bframe_pyramid",
+ .real_name = TRS("B-frame pyramid"),
+ .type = LQT_PARAMETER_INT,
+ .val_default = { .val_int = 0 },
+ .val_min = { .val_int = 0 },
+ .val_max = { .val_int = 2 },
+ .help_string = TRS("Keep some B-frames as references")
+ },
+#else
{
.name = "x264_b_bframe_pyramid",
.real_name = TRS("B-frame pyramid"),
@@ -103,6 +114,7 @@
.val_max = { .val_int = 1 },
.help_string = TRS("Keep some B-frames as references")
},
+#endif
{
.name = "x264_ratecontrol",
.real_name = TRS("Ratecontrol"),
Index: plugins/x264/x264.c
===================================================================
RCS file: /cvsroot/libquicktime/libquicktime/plugins/x264/x264.c,v
retrieving revision 1.30
diff -u -B -r1.30 x264.c
--- plugins/x264/x264.c 11 Mar 2009 14:25:50 -0000 1.30
+++ plugins/x264/x264.c 26 Oct 2009 11:02:55 -0000
@@ -67,7 +67,11 @@
lqt_dump(" i_bframe: %d\n", params->i_bframe); // 0.. X264_BFRAME_MAX
lqt_dump(" b_bframe_adaptive: %d\n", params->b_bframe_adaptive);
lqt_dump(" i_bframe_bias: %d\n", params->i_bframe_bias);
+#if X264_BUILD >= 78
+ lqt_dump(" i_bframe_pyramid: %d\n", params->i_bframe_pyramid);
+#else
lqt_dump(" b_bframe_pyramid: %d\n", params->b_bframe_pyramid);
+#endif
lqt_dump(" b_deblocking_filter: %d\n", params->b_deblocking_filter);
lqt_dump(" i_deblocking_filter_alphac0: %d\n", params->i_deblocking_filter_alphac0); // -6..6
@@ -174,14 +178,21 @@
{
uint8_t *p = buf;
int i;
+#if X264_BUILD < 76
int s;
+#endif
for(i = 0; i < nnal; i++)
{
+#if X264_BUILD >= 76
+ memcpy(p, nals[i].p_payload, nals[i].i_payload);
+ p+=nals[i].i_payload;
+#else
s = x264_nal_encode(p, &size, 1, nals + i);
if(s < 0)
return -1;
p += s;
+#endif
}
return p - buf;
@@ -407,7 +417,11 @@
pic_out.i_pts = 0;
/* Encode frames, get nals */
+#if X264_BUILD >= 76
+ if(x264_encoder_encode(codec->enc, &nal, &nnal, pic_in, &pic_out)<0)
+#else
if(x264_encoder_encode(codec->enc, &nal, &nnal, pic_in, &pic_out))
+#endif
return 0;
/* Encode nals -> get h264 stream */
@@ -782,7 +796,11 @@
ENUMPARAM("x264_i_bframe_adaptive", codec->params.i_bframe_adaptive, bframe_adaptives);
#endif
INTPARAM("x264_i_bframe_bias", codec->params.i_bframe_bias);
+#if X264_BUILD >= 78
+ INTPARAM("x264_i_bframe_pyramid", codec->params.i_bframe_pyramid);
+#else
INTPARAM("x264_b_bframe_pyramid", codec->params.b_bframe_pyramid);
+#endif
ENUMPARAM("x264_i_rc_method", codec->params.rc.i_rc_method, rc_methods);
INTPARAM("x264_i_bitrate", codec->params.rc.i_bitrate);