[FFmpeg-devel] Is there anybody want to merge fix-point wma back to ffmpeg?

William Xue william.xue
Thu Nov 8 01:45:58 CET 2007


On Wed, 07 Nov 2007 13:43:34 +0800, Luca Barbato <lu_zero at gentoo.org>  
wrote:

> William Xue wrote:
>> there are several fix-point versions based the version of libavcodec.
>> But it seems that there is not a native version for ffmpeg.
>>
>> I want to spend some time to do the job if no others want to do so.
>>
>
> Please do =)
>
> lu
>

I merged the codes yesterday, and the quality was a little worse.

But the worst thing is wma_decode_block returned -1 in arm cpu,
because of the following codes:

v = get_bits(&s->gb, n)
if (v >= s->nb_block_sizes)
{
	return -1;
}

I expanded the macros in get_bits:

static inline unsigned int get_bits(wmaGetBitContext *s, int n){
     register int tmp;


     int index = s->index;
     int cache = 0;

     int aa = ((uint8_t *)s->buffer)+(index>>3);

     av_log(NULL, AV_LOG_INFO, "get_bits. aa is %d, index is %d, buffer is  
%p, n is %d\n",aa, index, (uint8_t *)s->buffer, n);

     cache = unaligned32_be(aa);

     av_log(NULL, AV_LOG_INFO, "get_bits. aa is %d, cache is %d, index&0x07  
is %d\n", aa, cache, (index&0x07));

     cache <<= (index&0x07);

     tmp = NEG_USR32(cache, n);

     index += n;

     s->index = index;


/*     OPEN_READER(re, s) */
/*     UPDATE_CACHE(re, s) */
/*     tmp= SHOW_UBITS(re, s, n); */
/*     LAST_SKIP_BITS(re, s, n) */
/*     CLOSE_READER(re, s) */
     return tmp;
}

following is the log of the values in get_bits,

get_bits. aa is 1522103, index is 424, buffer is 0x173982, n is 3
get_bits. aa is 1522103, cache is -979499621, index&0x07 is 0

I will debug of course. but if somebody know the issue, plz drop me a  
message.

-- 
Yours,
William Xue




More information about the ffmpeg-devel mailing list