On Thu, Feb 18, 2010 at 05:35:59PM +0530, Mohamed Naufal wrote:
On 15 January 2010 05:41, Michael Niedermayer <michaelni at gmx.at> wrote:
[...]
+typedef struct YopDecContext { + AVFrame frame; + AVCodecContext *avctx; + AVPacket *avpkt; + + int num_pal_colors; + int first_color[2]; + int tag_needs_next_byte;
+ int current_tag_byte;
you dont need that variable
If I don't increment s->srcptr in the if block of yop_get_next_nibble(), color_num in yop_paint_block() can have an incorrect value.
you dont need the current_tag_byte variable
[...]
+/** + * Update the palette based on the frame number. Consume all of the palette + * bytes on the input. + */ +static void yop_update_palette(YopDecContext *s) +{ + int firstcolor; + int i, j; + + firstcolor = s->first_color[s->avctx->frame_number & 1];
this will be wrong with seeking id suspect
How else do I do it?
Either the demuxer marks only even frames as keyframe then the decoder can when it detects seeking start counting from even or the demuxer has to indicate if a frame is even or odd to the decoder also there is the question if they are keyframes or not, you obviosuly should not mark then incorrectly [...]
+ s->row_pos = 0; + + while ((size_t) s->dstptr - (size_t) s->dstbuf < + avctx->width * RGB_COLORS * avctx->height && + (size_t) s->srcptr - (size_t) avpkt->data < avpkt->size) { + current_nibble = yop_get_next_nibble(s);
useless casts [...]
+AVInputFormat yop_demuxer = { + "yop", + NULL_IF_CONFIG_SMALL("Psygnosis YOP Format"), + sizeof(YopDecContext), + yop_probe, + yop_read_header, + yop_read_packet, + yop_read_close, + .extensions = "yop", + .flags = AVFMT_GENERIC_INDEX, +};
thats missing code to flush the buffered packet in case of seeking [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User questions about the command line tools should be sent to the ffmpeg-user ML. And questions about how to use libav* should be sent to the libav-user ML.