Commit 3b82aeee authored by Anton Khirnov's avatar Anton Khirnov

libx264: add 'fast-pskip' private option.

Deprecate CODEC_FLAG2_FASTPSKIP.
parent 373257fa
...@@ -612,8 +612,8 @@ typedef struct RcOverride{ ...@@ -612,8 +612,8 @@ typedef struct RcOverride{
#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames #define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames
#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock #define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform #define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform
#endif
#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip #define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip
#endif
#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters #define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
#define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization #define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization
#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table. #define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table.
......
...@@ -55,6 +55,7 @@ typedef struct X264Context { ...@@ -55,6 +55,7 @@ typedef struct X264Context {
int b_pyramid; int b_pyramid;
int mixed_refs; int mixed_refs;
int dct8x8; int dct8x8;
int fast_pskip;
} X264Context; } X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args) static void X264_log(void *p, int level, const char *fmt, va_list args)
...@@ -247,7 +248,6 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -247,7 +248,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA; x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA;
x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP;
x4->params.analyse.i_trellis = avctx->trellis; x4->params.analyse.i_trellis = avctx->trellis;
x4->params.analyse.i_noise_reduction = avctx->noise_reduction; x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
...@@ -328,6 +328,7 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -328,6 +328,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED; x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS; x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS;
x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT; x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT;
x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP;
#endif #endif
if (x4->aq_mode >= 0) if (x4->aq_mode >= 0)
...@@ -355,6 +356,8 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -355,6 +356,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.b_mixed_references = x4->mixed_refs; x4->params.analyse.b_mixed_references = x4->mixed_refs;
if (x4->dct8x8 >= 0) if (x4->dct8x8 >= 0)
x4->params.analyse.b_transform_8x8 = x4->dct8x8; x4->params.analyse.b_transform_8x8 = x4->dct8x8;
if (x4->fast_pskip >= 0)
x4->params.analyse.b_fast_pskip = x4->fast_pskip;
if (x4->fastfirstpass) if (x4->fastfirstpass)
x264_param_apply_fastfirstpass(&x4->params); x264_param_apply_fastfirstpass(&x4->params);
...@@ -450,6 +453,7 @@ static const AVOption options[] = { ...@@ -450,6 +453,7 @@ static const AVOption options[] = {
{ "normal", "Non-strict (not Blu-ray compatible)", 0, FF_OPT_TYPE_CONST, {X264_B_PYRAMID_NORMAL}, INT_MIN, INT_MAX, VE, "b_pyramid" }, { "normal", "Non-strict (not Blu-ray compatible)", 0, FF_OPT_TYPE_CONST, {X264_B_PYRAMID_NORMAL}, INT_MIN, INT_MAX, VE, "b_pyramid" },
{ "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), FF_OPT_TYPE_INT, {-1}, -1, 1, VE }, { "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), FF_OPT_TYPE_INT, {-1}, -1, 1, VE },
{ "8x8dct", "High profile 8x8 transform.", OFFSET(dct8x8), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "8x8dct", "High profile 8x8 transform.", OFFSET(dct8x8), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "fast-pskip", NULL, OFFSET(fast_pskip), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ NULL }, { NULL },
}; };
......
...@@ -392,8 +392,8 @@ static const AVOption options[]={ ...@@ -392,8 +392,8 @@ static const AVOption options[]={
{"wpred", "weighted biprediction for b-frames (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"}, {"wpred", "weighted biprediction for b-frames (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"},
{"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, INT_MAX, V|E, "flags2"}, {"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, INT_MAX, V|E, "flags2"},
{"dct8x8", "high profile 8x8 transform (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_8X8DCT }, INT_MIN, INT_MAX, V|E, "flags2"}, {"dct8x8", "high profile 8x8 transform (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_8X8DCT }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif
{"fastpskip", "fast pskip (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FASTPSKIP }, INT_MIN, INT_MAX, V|E, "flags2"}, {"fastpskip", "fast pskip (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FASTPSKIP }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif
{"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"},
{"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"},
{"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, {.dbl = 20.0 }, FLT_MIN, FLT_MAX, V|E}, {"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, {.dbl = 20.0 }, FLT_MIN, FLT_MAX, V|E},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment