[FFmpeg-devel] [PATCH] Split reading and decoding of blocks in ALS
Michael Niedermayer
michaelni
Sun Dec 13 15:22:58 CET 2009
On Sun, Dec 13, 2009 at 11:54:06AM +0100, Thilo Borgmann wrote:
> Am 12.12.09 19:08, schrieb Michael Niedermayer:
> > On Sat, Dec 12, 2009 at 08:11:51AM +0100, Thilo Borgmann wrote:
> >> Am 12.12.09 00:20, schrieb Carl Eugen Hoyos:
> >>> Thilo Borgmann <thilo.borgmann <at> googlemail.com> writes:
> >>>
> >>>> I added a patch for clarification,
> >>>
> >>> No.
> >>
> >> Oh, thanks for reminding!
> > [...]
> >> /** Reads the block data for a constant block
> >> */
> >> -static void read_const_block(ALSDecContext *ctx, int32_t *raw_samples,
> >> - unsigned int block_length, unsigned int *js_blocks)
> >> +static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
> >> {
> >> ALSSpecificConfig *sconf = &ctx->sconf;
> >> AVCodecContext *avctx = ctx->avctx;
> >> GetBitContext *gb = &ctx->gb;
> >> - int32_t const_val = 0;
> >> - unsigned int const_block, k;
> >>
> >> - const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
> >> - *js_blocks = get_bits1(gb);
> >> + bd->const_val = 0;
> >> + bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
> >> + bd->js_blocks = get_bits1(gb);
> >>
> >> // skip 5 reserved bits
> >> skip_bits(gb, 5);
> >>
> >> - if (const_block) {
> >> + if (bd->const_block) {
> >> unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample;
> >> - const_val = get_sbits_long(gb, const_val_bits);
> >> + bd->const_val = get_sbits_long(gb, const_val_bits);
> >> }
> >>
> >> + // ensure constant block decoding by reusing this field
> >> + bd->const_block = 1;
> >
> > it seems const_block before this can stay as a local var
> > similar, if there are other variables tha can stay local they should
> >
> > [...]
> >>
> >> -
> >> if (!sconf->rlslms) {
> >
> > unrelated
> >
> > [...]
> >> }
> >>
> >> -
> >> /** Reads the block data.
> >> */
> >
> > hmm
> >
> > except these the patch should be ok
>
> Corrected all these as well as the issues mentioned in a previous review.
>
> -Thilo
> alsdec.c | 349 ++++++++++++++++++++++++++++++++++++++++++++-------------------
> 1 file changed, 248 insertions(+), 101 deletions(-)
> 11a6208b0b1cb8f22467e3f7eec5754ed1272c91 als_read_decode.rev1.patch
ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- 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/20091213/6e1e50d1/attachment.pgp>
More information about the ffmpeg-devel
mailing list