[FFmpeg-devel] [PATCH] MLP/TrueHD Decoder - 2nd try
Michael Niedermayer
michaelni
Mon Jun 30 11:27:37 CEST 2008
On Sun, Jun 29, 2008 at 12:41:17PM +0100, Ramiro Polla wrote:
> Hello,
>
> 01_mlp_parser_gb.diff makes a function in mlp_parser receive a
> GetBitContext instead of uint8_t buffers. This helps out in the decoder to
> simplify the code.
ok, after fixing issue below
>
> 02_mlpdec_buildsystem.diff is the build system changes for mlpdec.c
not my area
ill review the rest ASAP
[...]
> -int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, const uint8_t *buf,
> - unsigned int buf_size)
> +int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
> {
> - GetBitContext gb;
> int ratebits;
> uint16_t checksum;
>
> - if (buf_size < 28) {
> + assert(get_bits_count(gb) == 0);
> +
> + if (gb->size_in_bits < 28 << 3) {
> av_log(log, AV_LOG_ERROR, "Packet too short, unable to read major sync\n");
> return -1;
> }
>
> - checksum = mlp_checksum16(buf, 26);
> - if (checksum != AV_RL16(buf+26)) {
> + checksum = mlp_checksum16(gb->buffer, 26);
You should document the "no stuff read yet" requirement in a doxy comment
(or add get_bits_count()>>3 iam not sure which is better ...)
[...]
--
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/20080630/bda55df4/attachment.pgp>
More information about the ffmpeg-devel
mailing list