[Libav-user] change pixel format without scaling data ? // more3

jim morgenstern jmorgie at yahoo.com
Sat Jan 5 18:04:07 CET 2013

Code snippet:

#define RGB16  PIX_FMT_RGB48LE  // little endian

#define RGB    PIX_FMT_BGR24

#define YUV422 PIX_FMT_YUV422P10LE

#define YUV444 PIX_FMT_YUV444P16LE


void Rescaler ( uint8_t* input_data,  AVPicture* outp, int in_width, int
in_height, PixelFormat in_pix_fmt, int out_width, int out_height,
PixelFormat out_pix_fmt)


//initialize context and buffers

                              swsContext = sws_getContext(in_width,
in_height, in_pix_fmt, 

                                             out_width, out_height,
out_pix_fmt, SWS_BICUBIC, NULL, NULL, NULL);


                              inp    = new AVPicture;


                              avpicture_fill(inp, input_data, in_pix_fmt,
in_width, in_height);




                              avpicture_alloc(outp, out_pix_fmt, out_width,


                              int rc_ht = sws_scale ( swsContext, inp->data,
inp->linesize, in_width, in_height, outp->data, outp->linesize);



From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org]
On Behalf Of Roman Ryltsov
Sent: Saturday, January 05, 2013 11:15 AM
To: This list is about using libavcodec, libavformat, libavutil, libavdevice
and libavfilter.
Subject: Re: [Libav-user] change pixel format without scaling data ? // more



Well, that is my problem - it is not clear how it scales or why if I don't
request it!!  What we used to call an 'undocumented feature'


The input to the context is the input format, the input sizes, the output
format and the output sizes.  Gray levels, scaling, expected means etc.
have no part of the context or the input.  I would post my  code but I am
away from the workstation at the moment.  But if you look at the function
calls for sws_getcontext and  sws_scale you will no mention of modifying
gray levels.


A code snippet with your sws_* calls + values of arguments are worth many
words. Post this information here and we will see what is going on.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130105/20cbdc86/attachment.html>

More information about the Libav-user mailing list