From 76718f3fb75a7c2ba790ba7a110059fc120ee25e Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 3 Nov 2011 21:38:23 +0100 Subject: [PATCH 1/4] configure: declare dependency of h264_vaapi_hwaccel on h264_decoder --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index c23660e524..8a9ca6c7a4 100755 --- a/configure +++ b/configure @@ -1289,7 +1289,7 @@ h263p_encoder_select="h263_encoder" h264_decoder_select="golomb h264dsp h264pred" h264_dxva2_hwaccel_deps="dxva2api_h" h264_dxva2_hwaccel_select="dxva2 h264_decoder" -h264_vaapi_hwaccel_select="vaapi" +h264_vaapi_hwaccel_select="vaapi h264_decoder" h264_vdpau_decoder_select="vdpau h264_decoder" imc_decoder_select="fft mdct sinewin" jpegls_decoder_select="golomb" From adc85ce20bc18c7f2074e1e88d0eeaffde810ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 3 Nov 2011 14:12:14 +0200 Subject: [PATCH 2/4] avcodec: Set flags2 default value depending on availability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the code compile when FF_API_X264_GLOBAL_OPTS or FF_API_LAME_GLOBAL_OPTS is 0. Signed-off-by: Martin Storsjö --- libavcodec/options.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavcodec/options.c b/libavcodec/options.c index a08ed98cce..ef7a39a7c9 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -351,7 +351,17 @@ static const AVOption options[]={ {"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"inter_threshold", NULL, OFFSET(inter_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_BIT_RESERVOIR|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE }, 0, UINT_MAX, V|A|E|D, "flags2"}, +#if FF_API_X264_GLOBAL_OPTS +#define X264_DEFAULTS CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE +#else +#define X264_DEFAULTS 0 +#endif +#if FF_API_LAME_GLOBAL_OPTS +#define LAME_DEFAULTS CODEC_FLAG2_BIT_RESERVOIR +#else +#define LAME_DEFAULTS 0 +#endif +{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = X264_DEFAULTS|LAME_DEFAULTS }, 0, UINT_MAX, V|A|E|D, "flags2"}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, #if FF_API_ANTIALIAS_ALGO {"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D, "aa"}, From c38404ee1aad5f074f03487a0085931e7dcc6327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 3 Nov 2011 14:14:09 +0200 Subject: [PATCH 3/4] libx264: Set the default of the rc_lookahead option to -1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows it to use the defaults specified by preset/tune, without overwriting it with the default value from the AVCodecContext field. Signed-off-by: Martin Storsjö --- libavcodec/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/options.c b/libavcodec/options.c index ef7a39a7c9..e747408b19 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -492,7 +492,7 @@ static const AVOption options[]={ {"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E}, {"aq_mode", "specify aq method", OFFSET(aq_mode), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E}, {"aq_strength", "specify aq strength", OFFSET(aq_strength), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E}, -{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, {.dbl = 40 }, 0, INT_MAX, V|E}, +{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E}, {"ssim", "ssim will be calculated during encoding", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"}, {"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"}, {"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E}, From add7b1140fdd0651d0fc9352962631807126d3d0 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Thu, 3 Nov 2011 22:51:07 -0400 Subject: [PATCH 4/4] binkaudio: expand quant_table to accommodate all possible values --- libavcodec/binkaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index a90467abfb..d917e7a12c 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -39,7 +39,7 @@ extern const uint16_t ff_wma_critical_freqs[25]; -static float quant_table[95]; +static float quant_table[96]; #define MAX_CHANNELS 2 #define BINK_BLOCK_MAX_SIZE (MAX_CHANNELS << 11) @@ -112,7 +112,7 @@ static av_cold int decode_init(AVCodecContext *avctx) s->block_size = (s->frame_len - s->overlap_len) * s->channels; sample_rate_half = (sample_rate + 1) / 2; s->root = 2.0 / sqrt(s->frame_len); - for (i = 0; i < 95; i++) { + for (i = 0; i < 96; i++) { /* constant is result of 0.066399999/log10(M_E) */ quant_table[i] = expf(i * 0.15289164787221953823f) * s->root; }