[FFmpeg-devel] [PATCH] G.729 Frame erasure support for fixed-codebook vector decoding
Vladimir Voroshilov
voroshil
Sat Jun 27 04:43:27 CEST 2009
2009/6/27 Michael Niedermayer <michaelni at gmx.at>:
> On Sat, Jun 27, 2009 at 02:31:40AM +0700, Vladimir Voroshilov wrote:
>> subj
> [...]
>> @@ -224,6 +225,9 @@ static av_cold int decoder_init(AVCodecContext * avctx)
>> ? ? ?ctx->lsp[1] = ctx->lsp_buf[1];
>> ? ? ?memcpy(ctx->lsp[0], lsp_init, 10 * sizeof(int16_t));
>>
>> + ? ?/* random seed initialization */
>> + ? ?ctx->rand_value = 21845;
>
> the word pointless comes to mind, at least if this is just used for
> frame erasure handling
>
>
>> +
>> ? ? ?return 0;
>> ?}
>>
>> @@ -336,6 +340,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
>> ? ? ? ? ?/* Round pitch delay to nearest (used everywhere except ff_acelp_interpolate). */
>> ? ? ? ? ?pitch_delay_int ?= (pitch_delay_3x + 1) / 3;
>>
>> + ? ? ? ?if (frame_erasure) {
>> + ? ? ? ? ? ?ctx->rand_value = g729_prng(ctx->rand_value);
>> + ? ? ? ? ? ?fc_indexes ? = ctx->rand_value & ((1 << format.fc_indexes_bits) - 1);
>> +
>> + ? ? ? ? ? ?ctx->rand_value = g729_prng(ctx->rand_value);
>> + ? ? ? ? ? ?pulses_signs = ctx->rand_value & ((1 << format.fc_signs_bits) - 1);
>> + ? ? ? ?}
>
> a single call to the prng is probably enough also is the & really needed?
Well. Then i have to ask (you and other devs): "Does FFmpeg is
interested in having G.729 decoder
binary exact with reference one" (this means, capable of passing all
ITU's tests) .
Currently this is still possible to keep it such.
Or "just decode speech in any way, no mater what we get, if result is
understandable" is enough for you ?
Replacing pseudo-random generator with FFmpeg's internal one or
merging above two lines, definitely breaks
passing "erasure" ITU test.
Note also, that if i break bitexactness, i'll never have enough good
test for checking introduced bugs.
Decide.
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
More information about the ffmpeg-devel
mailing list