[FFmpeg-cvslog] r26219 - trunk/ffmpeg.c
Michael Niedermayer
michaelni
Wed Jan 5 17:45:21 CET 2011
On Wed, Jan 05, 2011 at 02:58:18PM +0100, Stefano Sabatini wrote:
> On date Wednesday 2011-01-05 05:52:32 +0100, michael wrote:
> > Author: michael
> > Date: Wed Jan 5 05:52:32 2011
> > New Revision: 26219
> >
> > Log:
> > Fix/cleanup m/ljpeg encoding pix fmt selection code in ffmpeg.c.
> > Better ideas are welcome ...
> >
> > Modified:
> > trunk/ffmpeg.c
> >
> > Modified: trunk/ffmpeg.c
> > ==============================================================================
> > --- trunk/ffmpeg.c Wed Jan 5 05:52:21 2011 (r26218)
> > +++ trunk/ffmpeg.c Wed Jan 5 05:52:32 2011 (r26219)
> > @@ -628,15 +628,18 @@ static void choose_pixel_fmt(AVStream *s
> > {
> > if(codec && codec->pix_fmts){
> > const enum PixelFormat *p= codec->pix_fmts;
> > + if(st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL){
>
> style...
ive no time for whitespace nitpicks, sorry, besides its quite consistent to the
surrounding code
>
> > + if(st->codec->codec_id==CODEC_ID_MJPEG){
> > + p= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE};
> > + }else if(st->codec->codec_id==CODEC_ID_LJPEG){
> > + p= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE};
> > + }
> > + }
>
> Having per-codec hacks in application code is hideously ugly and
> fragile.
This code was there before just bug fixed now
and Ive explicitly asked for suggestions to improve it, if you have some please
tell me, if not well yes i know this is ugly it was so before as well
> What's preventing to use AVCodec.pix_fmts in these cases?
There are 2 lists one for st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL
and one for the else case, and we have just one AVCodec.pix_fmts ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20110105/a5ec315b/attachment.pgp>
More information about the ffmpeg-cvslog
mailing list