On 23/08/16 17:28, Diego Biurrun wrote:
> On Thu, Aug 18, 2016 at 07:58:57PM +0200, Anton Khirnov wrote:
>> Quoting Diego Biurrun (2016-06-09 17:12:49)
>>> @@ -1658,34 +1657,34 @@ static void stabilize_lsps(double *lsps, int num)
>>> -static int check_bits_for_superframe(GetBitContext *orig_gb,
>>> +static int check_bits_for_superframe(BitstreamContext *orig_bc,
>>> WMAVoiceContext *s)
>>> {
>>> - GetBitContext s_gb, *gb = &s_gb;
>>> + BitstreamContext s_bc, *bc = &s_bc;
>>> int n, need_bits, bd_idx;
>>> const struct frame_type_desc *frame_desc;
>>>
>>> /* initialize a copy */
>>> - init_get_bits(gb, orig_gb->buffer, orig_gb->size_in_bits);
>>> - skip_bits_long(gb, get_bits_count(orig_gb));
>>> - assert(get_bits_left(gb) == get_bits_left(orig_gb));
>>> + bitstream_init(bc, orig_bc->buffer, orig_bc->size_in_bits);
>>> + bitstream_skip(bc, bitstream_tell(orig_bc));
>>> + assert(bitstream_bits_left(bc) == bitstream_bits_left(orig_bc));
>>
>> This could be just *bc = *orig_bc
>
> You mean
>
> BitstreamContext *bc = *orig_bc;
No.
> and then drop the function-local bitstream_init() call? Looks a tad
> unrelated to me. Also, I'm not sure what this would do to performance.
Basically that one makes a copy (state included) of orig_bc in s_bc by
using bitstream_init + skip.
You can do
BitstreamContext s_bc = *orig_bc;
Overall it should result in less instructions for nothing.
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel