Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve WMAPRO/XMA gapless output
> Is it intended that this doesnt list a human name ? > (its no problem but jb tends to be unhappy if there are no names in the log > so i try to ask people if they really intend to not list their name or if > its a unintended mistake) It's the nick/mail I use in github and other places, it's correct :) > this will need some change to > TESTwmapro-ism > stddev:0.00 PSNR:143.22 MAXDIFF:1 bytes: 884736/ 879952 > size: |884736 - 879952| >= 0 > Test wmapro-ism failed. Look at tests/data/fate/wmapro-ism.err for details. > make: *** [fate-wmapro-ism] Error 1 I've run the tests but I thought fixes would need changes in the (restricted) FATE suite server. If somebody could explain how to fix the test or point to some doc, but I think some more experienced dev should take care of it. I plan to refine WMAPRO output in some cases (once I investigate), so this will change again later anyway. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmadec: fix WMA gapless playback
> This will/would require several fate tests to be updated > at least these apparently: > make: *** [fate-wmav1-encode] Error 1 > make: *** [fate-wmav2-encode] Error 1 > make: *** [fate-flcl1905] Error 1 I'm not sure if I can and how to modify those, somebody could lend a hand? I can run the tests but not sure of how to interpret them. *** Note that FFmpeg's encoder doesn't produce files equivalent to Microsoft's encoder. FFmpeg encoder creates ASF files with 1 frame of skip samples/encoder delay (instead of ASF's 2 frames), and ASF packets/timestamps may be incorrect. Some players using MS's codecs (ex.- foobar2000) still skip 2 frames, while others that validate ASF timestamps (ex.- wma2wav) complain and not skip encoder delay all. XWMA (that don't have timestamps) do use 2 frames too, so I think that for standard Microsoft's WMA it decodes correctly now. I wanted to explain all that in a trac issue, since I don't know how to fix encoders. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve WMAPRO/XMA gapless output
I've sent the patch again with some tweaks and fixed the test, please check if it is satisfactory now. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve WMAPRO/XMA gapless output
> Can you confirm that if you break the decoder intentionally, the test > (still) fails? > > Thank you, Carl Eugen It does. Since file now writes 1 extra packet (as intended) so it'll always differ SIZE_TOLERANCE at min, so decoder changes will go over than value, I think. I tried -frames:a 108 (the original file has 108 packets, but now I output 109) so it wouldn't need SIZE_TOLERANZE, but I couldn't get FATE to use it. If I manually decode with frames:a 108 and compare old decoder vs new decode, files are identical. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve WMAPRO/XMA gapless output
> No, you need to set this during init. > You should also set avctx->delay to the same value. This value is part of the bitstream, so theoretically can appear in any packet after the first. Can you confirm it doesn't? How could it be set on init? You'd need to read the bitstream then rewind? And what if there are multiple skips in different packets? > Usually true? Decoders aren't usually true, they're always true. Usually true as those values are optional yet common, there is an "if" right below. > No, this is wrong. Codecs don't need to do this manually, this is done by > libavcodec/decode.c, based on the packet's AV_PKT_DATA_SKIP_SAMPLES side > data. All code with AV_PKT_DATA_SKIP_SAMPLES I see imply the use of av_packet_new_side_data and look like it'd need many changes, how should it be done? > This is confusing, you should split the patches affecting different codecs. XMA and WMAPRO are the same codec with minor configs differences, it seemed redundant to do 2 patches forcing 2 reviews of the same thing. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve WMAPRO/XMA gapless output
Ignore this patch, I've submitted a new one that hopefully has a better chance. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: improve XMA missing samples
> You can set final number of samples in output frame directly: > frame->nb_samples = X. I was told I shouldn't do that (even though other codecs do it?). I quote: >> No, this is wrong. Codecs don't need to do this manually, this is done by >> libavcodec/decode.c, based on the packet's AV_PKT_DATA_SKIP_SAMPLES side data. I think it would also have problems with xma_decode_packet since it only works with 512 nb_samples. So I hope this can patch accepted as-is and then it can be refined in later patches. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/wmaprodec: support multichannel XMA stream configurations
Here are samples of many stream configurations, generated with Microsoft's encoder: https://mega.nz/#!aQRUnTIT!gWUAfGNLIP62VKV2JEOGoyQ1jbVc3M7_qu7ChXQwb7w For real XMA used in games, I've only seen 2ch+..+2ch+1/2ch (usual, what FFmpeg supported before) and 1ch+..+1ch (rare, what motivates this patch). This adds support for all possible combinations though. I don't know enough about FATE to set up tests so I hope somebody could help, as the learning curve seems steep. 2017-10-03 23:49 GMT+02:00 : > From: bnnm > > Signed-off-by: bnnm > > Now accepts any combination of 1/2ch streams, described in the RIFF > chunks/extradata > --- > libavcodec/wmaprodec.c | 151 ++ > ++- > libavformat/wavdec.c | 20 --- > 2 files changed, 112 insertions(+), 59 deletions(-) > > diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c > index 5c99628c52..77a49c9db8 100644 > --- a/libavcodec/wmaprodec.c > +++ b/libavcodec/wmaprodec.c > @@ -106,6 +106,9 @@ > #define MAX_SUBFRAMES 32///< max > number of subframes per channel > #define MAX_BANDS 29///< max > number of scale factor bands > #define MAX_FRAMESIZE 32768 ///< maximum > compressed frame size > +#define XMA_MAX_STREAMS 8 > +#define XMA_MAX_CHANNELS8 > +#define XMA_MAX_CHANNELS_STREAM 2 > > #define WMAPRO_BLOCK_MIN_BITS 6 > ///< log2 of min block size > #define WMAPRO_BLOCK_MAX_BITS 13 > ///< log2 of max block size > @@ -215,7 +218,7 @@ typedef struct WMAProDecodeCtx { > uint8_t drc_gain; ///< gain for the DRC > tool > int8_t skip_frame;///< skip output step > int8_t parsed_all_subframes; ///< all subframes > decoded? > -uint8_t skip_packets; > +uint8_t skip_packets; ///< packets to skip > to find next packet in a stream (XMA1/2) > > /* subframe/block decode state */ > int16_t subframe_len; ///< current subframe > length > @@ -235,11 +238,13 @@ typedef struct WMAProDecodeCtx { > } WMAProDecodeCtx; > > typedef struct XMADecodeCtx { > -WMAProDecodeCtx xma[4]; > -AVFrame *frames[4]; > +WMAProDecodeCtx xma[XMA_MAX_STREAMS]; > +AVFrame *frames[XMA_MAX_STREAMS]; > int current_stream; > -float samples[8][512 * 64]; > -int offset[4]; > +int num_streams; > +float samples[XMA_MAX_CHANNELS][512 * 64]; > +int offset[XMA_MAX_STREAMS]; > +int start_channel[XMA_MAX_STREAMS]; > } XMADecodeCtx; > > /** > @@ -306,7 +311,7 @@ static av_cold int get_rate(AVCodecContext *avctx) > *@param avctx codec context > *@return 0 on success, -1 otherwise > */ > -static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx) > +static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx, > int num_stream) > { > uint8_t *edata_ptr = avctx->extradata; > unsigned int channel_mask; > @@ -333,18 +338,30 @@ static av_cold int decode_init(WMAProDecodeCtx *s, > AVCodecContext *avctx) > for (i = 0; i < avctx->extradata_size; i++) > av_log(avctx, AV_LOG_DEBUG, "[%x] ", avctx->extradata[i]); > av_log(avctx, AV_LOG_DEBUG, "\n"); > -if (avctx->codec_id == AV_CODEC_ID_XMA2 && (!avctx->extradata || > avctx->extradata_size >= 6)) { > + > +if (avctx->codec_id == AV_CODEC_ID_XMA2 && avctx->extradata_size == > 34) { /* XMA2WAVEFORMATEX */ > +s->decode_flags= 0x10d6; > +s->bits_per_sample = 16; > +channel_mask = 0; //AV_RL32(edata_ptr+2); /* not always in > expected order */ > +if ((num_stream+1) * XMA_MAX_CHANNELS_STREAM > avctx->channels) > /* stream config is 2ch + 2ch + ... + 1/2ch */ > +s->nb_channels = 1; > +else > +s->nb_channels = 2; > +} else if (avctx->codec_id == AV_CODEC_ID_XMA2) { /* XMA2WAVEFORMAT */ > s->decode_flags= 0x10d6; > -channel_mask = avctx->extradata ? AV_RL32(edata_ptr+2) : 0; > s->bits_per_sample = 16; > - } else if (avctx->codec_id == AV_CODEC_ID_XMA1) { > +channel_mask = 0; /* would need to aggregate from all > streams */ > +s->nb_channels = edata_ptr[32 + ((edata_ptr[0]==3)?0:8) + > 4*num_stream + 0]; /* nth stream config */ > +} else if (avctx->codec_id == AV_CODEC_ID_XMA1) { /* XMAWAVEFORMAT */ > s->decode_flags= 0x10d6; > s->bits_per_sample = 16; > -channel_mask = 0; > - } else if (avctx->codec_id == AV_CODEC_ID_WMAPRO && > avctx->extradata_size >= 18) { > +channel_mask = 0; /* would need to aggregate from all > streams */ > +s->nb_channels = edata_ptr[8 + 20*num_stream + 17]; /* nth > stream config */ > +} else if (avctx->codec_id == AV_CODEC_ID_WMAPRO && > avctx->extradata_size >= 18) { > s-
Re: [FFmpeg-devel] [PATCH] avformat/msf: fix codec 4 (joint stereo ATRAC3) and align
It should work with all proper MSF. Here is my test suite, which includes most MSF variations (including some not yet supported by FFmpeg) https://www.sendspace.com/file/omvv8s For example, there is no 1ch ATRAC3-codec4 test MSF because the encoder only outputs joint stereo I'm afraid I don't know enough about FATE to set up tests of my own. 2017-01-30 13:04 GMT+01:00 Paul B Mahol : > On 1/30/17, bananaman...@gmail.com wrote: > > From: bnnm > > > > Codec 4 (frame size 98) uses joint stereo per spec and examples. > > Also removed an incorrect "align" var which wasn't used anyway (it was > > overwrittern). > > > > Probably all/only .AT3 of frame size 98 are JS, too. > > > > Signed-off-by: bnnm > > --- > > libavformat/msf.c | 13 ++--- > > 1 file changed, 6 insertions(+), 7 deletions(-) > > Are you sure this doesn't break any msf files? > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/bink: fix latest header and add all existing revisions
Yes, it's my github handle, thanks. 2017-08-20 3:00 GMT+02:00 Michael Niedermayer : > On Sun, Aug 20, 2017 at 01:51:07AM +0200, Michael Niedermayer wrote: > > On Fri, Aug 18, 2017 at 07:45:16PM +0200, bananaman...@gmail.com wrote: > > > From: bnnm > > > > > > KB2 'i' found in Life is Strange (Xbox 360), rest verified against > binkconv.exe > > > > > > Signed-off-by: bnnm > > > --- > > > libavformat/bink.c | 17 + > > > 1 file changed, 13 insertions(+), 4 deletions(-) > > > > will apply > > before pushing, just to confirm > > "bnnm" is the intended Author ? (it cannot be changed later) > > [...] > > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > No human being will ever know the Truth, for even if they happen to say it > by chance, they would not even known they had done so. -- Xenophanes > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel