[FFmpeg-devel] [PATCH]Re: vorbis on bsd

Alex Converse alex.converse
Fri Aug 6 16:44:39 CEST 2010


On Fri, Aug 6, 2010 at 10:34 AM, Alex Converse <alex.converse at gmail.com> wrote:
> 2010/8/6 M?ns Rullg?rd <mans at mansr.com>:
>> This is ffmpeg-devel material.
>>
>> Michael Kostylev <michael.kostylev at gmail.com> writes:
>>
>>> --- freelsd-fate-vorbis-1.log
>>> +++ linux-fate-vorbis-1.log
>>> @@ -2020,7 +2020,7 @@
>>> ? 0.floor: 2 partitions
>>> ? 0. floor 0 partition class 0
>>> ? 0. floor 1 partition class 1
>>> - maximum class -1
>>> + maximum class 1
>>> ? 0 floor 0 class dim: 3 subclasses 2
>>> ? ? masterbook: 0
>>> ? ? ?book 0. : -1
...
>>>
>>> Unrolling r23811 makes fate-vorbis happy.
>>>
>
> From r23811
>
> ?66 typedef struct {
> ?67 ? ? uint_fast8_t floor_type;
> ?68 ? ? vorbis_floor_decode_func decode;
> ?69 ? ? union vorbis_floor_u {
> ?70 ? ? ? ? struct vorbis_floor0_s {
> ?71 ? ? ? ? ? ? uint_fast8_t ?order;
> ?72 ? ? ? ? ? ? uint_fast16_t rate;
> ?73 ? ? ? ? ? ? uint_fast16_t bark_map_size;
> ?74 ? ? ? ? ? ? int_fast32_t *map[2];
> ?75 ? ? ? ? ? ? uint_fast32_t map_size[2];
> ?76 ? ? ? ? ? ? uint_fast8_t ?amplitude_bits;
> ?77 ? ? ? ? ? ? uint_fast8_t ?amplitude_offset;
> ?78 ? ? ? ? ? ? uint_fast8_t ?num_books;
> ?79 ? ? ? ? ? ? uint_fast8_t *book_list;
> ?80 ? ? ? ? ? ? float ? ? ? ?*lsp;
> ?81 ? ? ? ? } t0;
> ?82 ? ? ? ? struct vorbis_floor1_s {
> ?83 ? ? ? ? ? ? uint_fast8_t partitions;
> ?84 ? ? ? ? ? ? uint_fast8_t partition_class[32];
> ?85 ? ? ? ? ? ? uint_fast8_t class_dimensions[16];
> ?86 ? ? ? ? ? ? uint_fast8_t class_subclasses[16];
> ?87 ? ? ? ? ? ? uint_fast8_t class_masterbook[16];
> ?88 ? ? ? ? ? ? int_fast16_t subclass_books[16][8];
> ?89 ? ? ? ? ? ? uint_fast8_t multiplier;
> ?90 ? ? ? ? ? ? uint_fast16_t x_list_dim;
> ?91 ? ? ? ? ? ? vorbis_floor1_entry *list;
> ?92 ? ? ? ? } t1;
> ?93 ? ? } data;
> ?94 } vorbis_floor;
>
> ?476 ? ? ? ? if (floor_setup->floor_type == 1) {
> ?477 ? ? ? ? ? ? int maximum_class = -1;
>
> This had been uint_fast8_t
>
> ?478 ? ? ? ? ? ? uint_fast8_t ?rangebits;
> ?479 ? ? ? ? ? ? uint_fast16_t floor1_values = 2;
> ?480
> ?481 ? ? ? ? ? ? floor_setup->decode = vorbis_floor1_decode;
> ?482
> ?483 ? ? ? ? ? ? floor_setup->data.t1.partitions = get_bits(gb, 5);
> ?484
> ?485 ? ? ? ? ? ? AV_DEBUG(" %d.floor: %d partitions \n", i,
> floor_setup->data.t1.partitions);
> ?486
> ?487 ? ? ? ? ? ? for (j = 0; j < floor_setup->data.t1.partitions; ++j) {
> ?488 ? ? ? ? ? ? ? ? floor_setup->data.t1.partition_class[j] = get_bits(gb, 4);
> ?489 ? ? ? ? ? ? ? ? if (floor_setup->data.t1.partition_class[j] >
> maximum_class)
>
> So if uint_fast8_t is uint8_t or uint16_t then partition_class[j] gets
> promoted to int
> If uint_fast8_t is uint32_t then maximum_class gets promoted to
> uint32_t and this condition becomes always false...
> maximum_class remains unchanged from its initial -1
>
> Hooray for (u)int_fast##_t types
>
> ?490 ? ? ? ? ? ? ? ? ? ? maximum_class =
> floor_setup->data.t1.partition_class[j];
> ?491
> ?492 ? ? ? ? ? ? ? ? AV_DEBUG(" %d. floor %d partition class %d \n",
> i, j, floor_setup->data.t1.partition_class[j]);
> ?493
> ?494 ? ? ? ? ? ? }
>

I *think* this patch should fix it. I don't have an OpenBSD box to test it on.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vorbis-partition_class-type.diff
Type: text/x-patch
Size: 529 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100806/10e2a53e/attachment.bin>



More information about the ffmpeg-devel mailing list