[FFmpeg-devel] [PATCH] swscale: add API to convert AVFrames directly

Michael Niedermayer michaelni at gmx.at
Thu Oct 3 12:20:03 CEST 2013


On Thu, Oct 03, 2013 at 10:45:25AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2013-10-01 19:00:11 +0200, wm4 encoded:
> > On Tue, 1 Oct 2013 13:34:28 +0200
> > Stefano Sabatini <stefasab at gmail.com> wrote:
[...]
> [...] 
> > > > +static void sws_set_avframe_colorspace_table(int table[4],
> > > > +                                             enum AVColorSpace colorspace)
> > > > +{
> > > > +    int i;
> > > 
> > > > +    int swscsp = colorspace; // this is libavfilter/vf_scale.c's dirty secret
> > > > +    const int *sws_table = sws_getCoefficients(swscsp);
> > > 
> > > why the intermediary swscsp variable?
> > > 
> > > Also I'd prefer to avoid the reference to scale.
> > 
> > The first line converts AVColorSpace to libswscale colorspace
> > constants, but they happen to use the same values - this is
> > undocumented, but vf_scale.c relies on it, so...
> 
> Why don't you do:
> sws_getCoefficients(colorspace)?

this function name is ambigous
coefficients can be for colorspace yuv->rgb or rgb->yuv (these differ)
or scaling itself
or the sws filters

doesnt matter all that much for a static function but as it has sws_
prefix it might one day become public and its IMHO a poor name for
a public function


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- 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/20131003/de68f43d/attachment.asc>


More information about the ffmpeg-devel mailing list