Re: [PATCH] Vorbis Encoder
Oded Shimon <ods15 <at> ods15.dyndns.org>
2006-10-01 08:28:29 GMT
On Sun, Oct 01, 2006 at 10:04:43AM +0200, Michael Niedermayer wrote:
> On Sat, Sep 30, 2006 at 11:33:49PM +0300, Oded Shimon wrote:
> [..]
> duplicate of nth_root() of vorbis.c
[..]
> this looks like a duplicate of vorbis_len2vlc() in vorbis.c
[..]
> that one looks like its part of vorbis_parse_setup_hdr_floors() from vorbis.c
> please remove all code duplications between vorbis.c & vorbis_enc.c
> ill review the rest after you removed all duplicate code
It's quite non trivial to remove all duplicate code between vorbis.c and
vorbis_enc.c, because even though the algos are the same, the structs are
completely different. The only way I can think of doing is by using common
struct names with similar members, and have these helper functions in
vorbis.h, and include vorbis.h AFTER the struct definitions in vorbis.c
and vorbis_enc.c (same code, but different compilation for different
files). This seems quite dirty, is this the way you intended?
> [...]
> > int codebook_sizes[] = { 16, 8, 256, 64, 128, 32, 96, 32, 96, 17, 32, 78, 17, 32, 78, 100, 1641, 443, 105, 68,
81, 289, 81, 121, 169, 25, 169, 225, 289, };
> > int * codebook_lens[] = { codebook0, codebook1, codebook2, codebook3, codebook4, codebook5,
codebook6, codebook7,
> > codebook8, codebook9, codebook10, codebook11, codebook12, codebook13, codebook14, codebook15,
> > codebook16, codebook17, codebook18, codebook19, codebook20, codebook21, codebook22, codebook23,
> > codebook24, codebook25, codebook26, codebook27, codebook28, };
> >
>
> why is this int and not (u)int8_t ?
(Continue reading)