[FFmpeg-devel] [PATCH]Basic XSUB encoder (take 5)

Michael Niedermayer michaelni
Thu Jun 18 19:20:59 CEST 2009


On Sat, May 23, 2009 at 11:03:31PM +0200, Reimar D?ffinger wrote:
> On Sat, May 23, 2009 at 06:54:55PM +0200, Diego Biurrun wrote:
> > On Sat, May 23, 2009 at 05:22:44PM +0200, Reimar D?ffinger wrote:
> > > 
> > > Haven't done anything on the muxer code part, but I fixed the trivial
> > > stuff pointed out here and one or two more simplifications and updated
> > > to SVN.
> > 
> > > --- libavcodec/xsubenc.c	(revision 0)
> > > +++ libavcodec/xsubenc.c	(revision 0)
> > > @@ -0,0 +1,224 @@
> > > +    if (xsub_encode_rle(&pb,
> > > +                h->rects[0]->pict.data[0],
> > > +                h->rects[0]->pict.linesize[0]*2,
> > > +                h->rects[0]->w, (h->rects[0]->h + 1) >> 1))
> > > +
> > > +    if (xsub_encode_rle(&pb,
> > > +            h->rects[0]->pict.data[0] + h->rects[0]->pict.linesize[0],
> > > +            h->rects[0]->pict.linesize[0]*2,
> > > +            h->rects[0]->w, h->rects[0]->h >> 1))
> > 
> > This looks weirdly indented.
> > 
> > > --- libavformat/avienc.c	(revision 18911)
> > > +++ libavformat/avienc.c	(working copy)
> > > @@ -212,8 +215,10 @@
> > > -        if(stream->codec_type == CODEC_TYPE_VIDEO)
> > > +        if(stream->codec_type == CODEC_TYPE_VIDEO
> > > +                || stream->codec_type == CODEC_TYPE_SUBTITLE)
> > 
> > If you keep the || on the first line, you can align this nicely.
> 
> Both changed, avi muxer and pts handling parts unchanged (those are
> hopefully the only parts that need to be changed still).

>  Changelog              |    1 
>  doc/general.texi       |    2 
>  ffmpeg.c               |    1 
>  libavcodec/Makefile    |    1 
>  libavcodec/allcodecs.c |    2 
>  libavcodec/avcodec.h   |    3 
>  libavcodec/xsubenc.c   |  222 +++++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/avienc.c   |    8 +
>  8 files changed, 236 insertions(+), 4 deletions(-)
> b6d1aec3963c4085b5e6599304ed6eac4dc912db  xsubenc.diff
[...]
>  OBJS-$(CONFIG_ZMBV_DECODER)            += zmbv.o
> Index: libavcodec/xsubenc.c
> ===================================================================
> --- libavcodec/xsubenc.c	(revision 0)
> +++ libavcodec/xsubenc.c	(revision 0)
[...]
> +#include "avcodec.h"
> +#include "bytestream.h"
> +#include "put_bits.h"
> +
> +/**
> + * Number of pixels to pad left and right.
> + *
> + * The official encoder pads the subtitles with two pixels on either side,
> + * but until we find out why we won't do it (we will pad to have width
> + * divisible by 2 though).
> + */
> +#define PADDING 0
> +#define PADDING_COLOR 0
> +

> +/**
> + * Encode a single color run. At most 16 bits will be used.
> + * \param len length of the run, values > 255 mean "until end of line", may not be < 0.
> + * \param color color to encode, only the lowest two bits are used and all others must be 0.

please align the description start below each other

except that the rest of the remaining patch looks ok

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- 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/20090618/073fb4e3/attachment.pgp>



More information about the ffmpeg-devel mailing list