[FFmpeg-devel] [PATCH] Electronic Arts CMV decoder

Michael Niedermayer michaelni
Fri Jul 4 15:59:08 CEST 2008


On Fri, Jul 04, 2008 at 10:46:09PM +1000, pross at xvid.org wrote:
> On Thu, Jul 03, 2008 at 04:42:21PM +0200, Michael Niedermayer wrote:
> > On Thu, Jul 03, 2008 at 10:58:05PM +1000, pross at xvid.org wrote:
> > > On Wed, Jul 02, 2008 at 08:27:01PM +0200, Michael Niedermayer wrote:
> > > > On Tue, Jul 01, 2008 at 10:36:41PM +1000, pross at xvid.org wrote:
> > > > > Hi,
> > > > > 
> > > > > This patch adds EA CMV support to FFmpeg.
> > > > > 
> > > > > Apply the decoder patch first, then the demuxer patch.
> > > > > 
> > > > > Samples: http://samples.mplayerhq.hu/game-formats/ea-cmv/
> > > > > Information: http://wiki.multimedia.cx/index.php?title=Electronic_Arts_CMV
> > > > 
> > > > [...]
> > > 
> > > Thanks to Diego and Michael for taking the time to review.
> > > 
> > > Revised patch enclosed.
> > 
> > a buf_end would avoid the - (EA_PREAMBLE_SIZE+2)
> > also a
> > buf += EA_PREAMBLE_SIZE would simplify the code a little
> 
> Yep, much simpler. Revised patch enclosed.
> 

> This is the first of five EA codecs that I intend to submit. Each is dervied
> from the large EA patch that was posted to -devel in 2007.

Dont fear this one is already close to being approved ...


[...]
> @@ -299,6 +301,11 @@
>                  err = process_audio_header_sead(s);
>                  break;
>  
> +            case MVIh_TAG :
> +                ea->video_codec = CODEC_ID_CMV;
> +                ea->time_base = (AVRational){0,0};
> +                break;
> +
>              case MVhd_TAG :
>                  err = process_video_header_vp6(s);
>                  break;
> @@ -441,6 +448,10 @@
>              packet_read = 1;
>              break;
>  
> +        case MVIh_TAG:
> +        case MVIf_TAG:
> +            url_fseek(pb, -8, SEEK_CUR);     // include chunk preamble
> +            chunk_size += 8;
>          case MV0K_TAG:
>              key = PKT_FLAG_KEY;
>          case MV0F_TAG:

After rethinking this a little, iam not sure anymore that this is the correct
solution.
Is there one MVIh per file? several?
are all MVIf keyframes, this does not seem to be true but it is set as if it
where.

Libavformat expects that starting decoding with any keyframe is possible.
(thats kinda logic, it just states how seeking works)

Thus i belive correct would be to either put MVIh_TAG in extradata (this
requires that there are no 2 different MVIh_TAG in the file) and then mark
all keyframes properly.

Or

if there are many MVIh_TAG in the file, consider MVIh_TAG keyframes and
MVIf_TAG non keyframes.

[...]
> +static av_cold int cmv_decode_end(AVCodecContext *avctx){
> +    CmvContext *s = avctx->priv_data;
> +    if (s->last_frame.data[0])
> +        s->avctx->release_buffer(avctx, &s->last_frame);
> +    if (s->last2_frame.data[0])
> +        s->avctx->release_buffer(avctx, &s->last2_frame);

I think this is missing s->frame

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080704/99ce90ac/attachment.pgp>



More information about the ffmpeg-devel mailing list