Commit a403fc03 authored by Justin Ruggles's avatar Justin Ruggles Committed by Michael Niedermayer

flac-lpc patch by (Justin Ruggles jruggle earthlink net)

tabs removed and regression.sh fixed (it was missing in the patch) by me

Originally committed as revision 5572 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 78f67b7a
...@@ -1983,6 +1983,58 @@ typedef struct AVCodecContext { ...@@ -1983,6 +1983,58 @@ typedef struct AVCodecContext {
* - decoding: unused * - decoding: unused
*/ */
int b_sensitivity; int b_sensitivity;
/**
* - encoding: set by user.
* - decoding: unused
*/
int compression_level;
#define FF_COMPRESSION_DEFAULT -1
/**
* sets whether to use LPC mode - used by FLAC encoder
* - encoding: set by user.
* - decoding: unused.
*/
int use_lpc;
/**
* LPC coefficient precision - used by FLAC encoder
* - encoding: set by user.
* - decoding: unused.
*/
int lpc_coeff_precision;
/**
* - encoding: set by user.
* - decoding: unused.
*/
int min_prediction_order;
/**
* - encoding: set by user.
* - decoding: unused.
*/
int max_prediction_order;
/**
* search method for selecting prediction order
* - encoding: set by user.
* - decoding: unused.
*/
int prediction_order_method;
/**
* - encoding: set by user.
* - decoding: unused.
*/
int min_partition_order;
/**
* - encoding: set by user.
* - decoding: unused.
*/
int max_partition_order;
} AVCodecContext; } AVCodecContext;
/** /**
......
This diff is collapsed.
...@@ -744,6 +744,14 @@ static AVOption options[]={ ...@@ -744,6 +744,14 @@ static AVOption options[]={
{"mv0_threshold", NULL, OFFSET(mv0_threshold), FF_OPT_TYPE_INT, 256, 0, INT_MAX, V|E}, {"mv0_threshold", NULL, OFFSET(mv0_threshold), FF_OPT_TYPE_INT, 256, 0, INT_MAX, V|E},
{"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"}, {"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"},
{"b_sensitivity", NULL, OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E}, {"b_sensitivity", NULL, OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E},
{"compression_level", NULL, OFFSET(compression_level), FF_OPT_TYPE_INT, FF_COMPRESSION_DEFAULT, INT_MIN, INT_MAX, V|A|E},
{"use_lpc", NULL, OFFSET(use_lpc), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
{"lpc_coeff_precision", NULL, OFFSET(lpc_coeff_precision), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|E},
{"min_prediction_order", NULL, OFFSET(min_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
{"max_prediction_order", NULL, OFFSET(max_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
{"prediction_order_method", NULL, OFFSET(prediction_order_method), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
{"min_partition_order", NULL, OFFSET(min_partition_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
{"max_partition_order", NULL, OFFSET(max_partition_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
{NULL}, {NULL},
}; };
...@@ -800,6 +808,13 @@ void avcodec_get_context_defaults(AVCodecContext *s){ ...@@ -800,6 +808,13 @@ void avcodec_get_context_defaults(AVCodecContext *s){
s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE
s->mv0_threshold= 256; s->mv0_threshold= 256;
s->b_sensitivity= 40; s->b_sensitivity= 40;
s->compression_level = FF_COMPRESSION_DEFAULT;
s->use_lpc = -1;
s->min_prediction_order = -1;
s->max_prediction_order = -1;
s->prediction_order_method = -1;
s->min_partition_order = -1;
s->max_partition_order = -1;
s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS; s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS;
s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS; s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS;
......
...@@ -176,7 +176,7 @@ stddev:1050.18 PSNR:35.89 bytes:1054720 ...@@ -176,7 +176,7 @@ stddev:1050.18 PSNR:35.89 bytes:1054720
264236 ./data/a-adpcm_yam.wav 264236 ./data/a-adpcm_yam.wav
e92cec8c07913ffb91ad2b11f79cdc00 *./data/out.wav e92cec8c07913ffb91ad2b11f79cdc00 *./data/out.wav
stddev:18312.68 PSNR:11.06 bytes:1056768 stddev:18312.68 PSNR:11.06 bytes:1056768
9ab5f311b70bc1fa8591b891db50b386 *./data/a-flac.flac c3382f03ce2efb5d475240d288a33898 *./data/a-flac.flac
353384 ./data/a-flac.flac 353368 ./data/a-flac.flac
c4228df189aad9567a037727d0e763e4 *./data/out.wav c4228df189aad9567a037727d0e763e4 *./data/out.wav
stddev: 33.31 PSNR:65.87 bytes:1040384 stddev: 33.31 PSNR:65.87 bytes:1040384
...@@ -599,7 +599,7 @@ fi ...@@ -599,7 +599,7 @@ fi
if [ -n "$do_flac" ] ; then if [ -n "$do_flac" ] ; then
# encoding # encoding
file=${outfile}flac.flac file=${outfile}flac.flac
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec flac $file do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec flac -compression_level 2 $file
# decoding # decoding
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
......
...@@ -176,7 +176,7 @@ stddev:1050.18 PSNR:35.89 bytes:1054720 ...@@ -176,7 +176,7 @@ stddev:1050.18 PSNR:35.89 bytes:1054720
264236 ./data/a-adpcm_yam.wav 264236 ./data/a-adpcm_yam.wav
e92cec8c07913ffb91ad2b11f79cdc00 *./data/out.wav e92cec8c07913ffb91ad2b11f79cdc00 *./data/out.wav
stddev:18312.68 PSNR:11.06 bytes:1056768 stddev:18312.68 PSNR:11.06 bytes:1056768
9ab5f311b70bc1fa8591b891db50b386 *./data/a-flac.flac c3382f03ce2efb5d475240d288a33898 *./data/a-flac.flac
353384 ./data/a-flac.flac 353368 ./data/a-flac.flac
c4228df189aad9567a037727d0e763e4 *./data/out.wav c4228df189aad9567a037727d0e763e4 *./data/out.wav
stddev: 33.31 PSNR:65.87 bytes:1040384 stddev: 33.31 PSNR:65.87 bytes:1040384
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