[FFmpeg-devel] [PATCH] G.729 Frame erasure support for fixed-codebook vector decoding
Michael Niedermayer
michaelni
Sat Jun 27 01:56:20 CEST 2009
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?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090627/fb0e26be/attachment.pgp>
More information about the ffmpeg-devel
mailing list