[FFmpeg-devel] [PATCH]The ljpeg encoder does not support transparency

Michael Niedermayer michaelni at gmx.at
Thu Feb 9 17:39:55 CET 2012


On Thu, Feb 09, 2012 at 10:28:24AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Users may think attached patch introduce a regression, but since the ljpeg 
> encoder never supported encoding transparency, I consider it a fix.
> 
> An alternative would be to continue to claim to encode BGRA and add BGR0 and 
> BGR24. Since there is indication that BGRA is actually possible (see ticket 
> #896), and we just had a version bump, I prefer this solution.
> 
> (There is an orthogonal problem that the ljpeg encoder does not tell which 
> colour spaces it supports.)
> 
> Please review, Carl Eugen

>  ljpegenc.c      |    8 +++++++-
>  mjpegenc.c      |    2 +-
>  mpegvideo_enc.c |    6 ++++--
>  3 files changed, 12 insertions(+), 4 deletions(-)
> fab8f834213f38b3de07b145dba94da78d16e734  patchljpegbgr0.diff
> diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
> index f8178d5..0fcb971 100644
> --- a/libavcodec/ljpegenc.c
> +++ b/libavcodec/ljpegenc.c
> @@ -56,7 +56,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in
>  
>      s->header_bits= put_bits_count(&s->pb);
>  
> -    if(avctx->pix_fmt == PIX_FMT_BGRA){
> +    if(avctx->pix_fmt == PIX_FMT_BGR0 || avctx->pix_fmt == PIX_FMT_BGR24){

i suggest to leave RǴBA until alpha is supported so theres no
regression

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120209/be9b7765/attachment.asc>


More information about the ffmpeg-devel mailing list