[Ffmpeg-devel] [PATCH] Targa encoder

Bobby Bingham uhmmmm
Mon Mar 12 02:56:47 CET 2007


Michael Niedermayer wrote:
>>  
>> +static int encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data){
> 
> please place the encoder into its own source file
> 

fixed

>> +    /* zero out the header and only set applicable fields */
>> +    memset(outbuf, 0, 18);
> 
> 12..18 are writen too anyway so theres no sense in memseting them
> 

fixed

>> +    switch(avctx->pix_fmt) {
>> +    case PIX_FMT_GRAY8:
>> +        outbuf[2] = 3;           /* uncompressed grayscale image */
>> +        outbuf[16] = 8;          /* bpp */
> 
> avctx->bits_per_sample

I gave this a try, but this value seems to be zero when the encoder gets 
called.  Where is this value set?  Other simple image encoders (pnm, 
png, etc) seem not to make use of it either.

-- 
Bobby Bingham
??????????????????????




More information about the ffmpeg-devel mailing list