[FFmpeg-devel] a64 encoder
Bitbreaker/METALVOTZE
bitbreaker
Sat Jan 17 10:29:47 CET 2009
> static const uint8_t ecm_symbols[][8]={
>
Oops. Missed one :-)
>
>> + if(c->mc_charmaps==NULL) c->mc_charmaps=av_malloc (1000* c->mc_lifetime*sizeof(int));
>> + if(c->mc_resolve_map==NULL) c->mc_resolve_map=av_malloc(1000* c->mc_lifetime*sizeof(int));
>> + if(c->mc_block_stats==NULL) c->mc_block_stats=av_malloc(1000* c->mc_lifetime*sizeof(int));
>> + if(c->meta_charset==NULL) c->meta_charset=av_malloc (32000*c->mc_lifetime*sizeof(uint8_t));
>>
>
> The argument to those ifs will always evaluate to true, init_encoder()
> is only called once per context.
>
If it is for usre called only once, than it is okay, i remmeber
something about mplayer that at least calls the init of vo_ modules more
than once in certain cases. So i'll remove the checks.
>
> IMO it would be cleaner if you just remove this wrapper function, move
> the AVCodec a64***={...} declaration to where the xxx_decode_frame()
> function is and make a64_init_encoder() a non static function (renamed
> to something like ff_a64_shared_init()).
>
Meanwhile the code shrank so far, that a64enc.c is really more or less
the init, nothing else. So i will restructure things so that each
encoding mode gets its own a64*** declaration. The init +A64Context
might then be in something like a64common.c/.h
Kindest regards,
Toby
More information about the ffmpeg-devel
mailing list