[FFmpeg-devel] [PATCH] G.729 Frame erasure support for LSF decoding

Vladimir Voroshilov voroshil
Wed Jun 24 15:18:23 CEST 2009


2009/6/24 Michael Niedermayer <michaelni at gmx.at>:
> On Sat, Jun 20, 2009 at 02:26:59PM +0700, Vladimir Voroshilov wrote:
>
> [...]
>> diff --git ffmpeg-r19218/libavcodec/g729data.h ffmpeg-r19218_v163/libavcodec/g729data.h
>> index a70c705..e202331 100644
>> --- ffmpeg-r19218/libavcodec/g729data.h
>> +++ ffmpeg-r19218_v163/libavcodec/g729data.h
>> @@ -275,4 +275,14 @@ static const int16_t cb_ma_predictor_sum[2][10] = { /* (0.15) */
>> ? ?{14585, 18333, 19772, 17344, 16426, 16459, 15155, 15220, 16043, 15708}
>> ?};
>>
>> +/**
>> + * ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2^27
>> + * ff_g729_cb_ma_predictor_sum_inv[j][i] = ---------------------------------
>> + * ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ff_g720_cb_ma_predictor_sum[j][i]
>> + */
>
> my guess would be that this is also not really "="
>
>
> [...]
>> - ? ?ma_predictor ? ? = get_bits(&gb, 1);
>> - ? ?quantizer_1st ? ?= get_bits(&gb, VQ_1ST_BITS);
>> - ? ?quantizer_2nd_lo = get_bits(&gb, VQ_2ND_BITS);
>> - ? ?quantizer_2nd_hi = get_bits(&gb, VQ_2ND_BITS);
>> +
>> + ? ?if(frame_erasure) {
>> + ? ? ? ?skip_bits(&gb, 1 + VQ_1ST_BITS + VQ_2ND_BITS + VQ_2ND_BITS);
>> +
>> + ? ? ? ?lsf_restore_from_previous(ctx->lsfq, ctx->past_quantizer_outputs,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ctx->ma_predictor);
>> + ? ?} else {
>> + ? ? ? ?uint8_t quantizer_1st; ? ?///< first stage vector of quantizer
>> + ? ? ? ?uint8_t quantizer_2nd_lo; ///< second stage lower vector of quantizer (size in bits)
>> + ? ? ? ?uint8_t quantizer_2nd_hi; ///< second stage higher vector of quantizer (size in bits)
>> +
>> + ? ? ? ?ctx->ma_predictor = get_bits(&gb, 1);
>> + ? ? ? ?quantizer_1st ? ? = get_bits(&gb, VQ_1ST_BITS);
>> + ? ? ? ?quantizer_2nd_lo ?= get_bits(&gb, VQ_2ND_BITS);
>> + ? ? ? ?quantizer_2nd_hi ?= get_bits(&gb, VQ_2ND_BITS);
>>
>
> reindent besides i dont like the change, its useless to replace them
> by skip

I though this version is more clean due to localized usage of variables.
It also shows that in erasure case reading of quantizer values is not used.

here is my early version without skip, but with two variables per MA
predictor (current/prev values).

>
> [...]
> --
> Michael ? ? GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I know you won't believe me, but the highest form of Human Excellence is
> to question oneself and others. -- Socrates
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iD8DBQFKQhyAYR7HhwQLD6sRAqbmAJ9X+vNWn4hUe6wbx4E2N9b2m/5kewCfbT75
> eebcJKUToG4NAOOjMQa7TBs=
> =ejdq
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Frame-erasure-support-for-LSF-decoding.170.patch
Type: text/x-diff
Size: 3255 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090624/30b7a39c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Indentation-fix-in-LSF.170.patch
Type: text/x-diff
Size: 1024 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090624/30b7a39c/attachment-0001.patch>



More information about the ffmpeg-devel mailing list