[FFmpeg-devel] [Bulk] Re: [PATCH] smptebars filter

Stefano Sabatini stefasab at gmail.com
Mon Aug 6 10:32:59 CEST 2012


On date Friday 2012-08-03 16:02:53 +0200, Stefano Sabatini encoded:
> On date Friday 2012-08-03 08:59:56 +0100, Tim Nicholson encoded:
[...]
> > My values are based upon:-
> > 0 IRE units= 0; 100 IRE units= 255; RGB
> > 
> > For the pluge section this gives
> > 
> > black= 255*7.5/100 = 19.125    => 19
> > black-4= 255*3.5/100 = 8.925   =>  9
> > black+4= 255*11.5/100 = 29.325 => 29
> > 
> > For the Q,-I sections
> > 
> > Using the Rec 601 coefficients (ffmpegs default RGB to YUV matrix)
> > 
> > Q:/  RGB 67,  0, 130 => YUV 46, 175, 148 (after rounding)
> > -I:/ RGB  0, 68, 114 => YUV 61. 158.  95 (after rounding)
> > 
> > The "correct" values being (see the avisynth page or poynton for
> > detailed maths)
> > 
> > Q:/  YUV 16, 175,148
> > -I:/ YUV 16, 158, 95
> > 
> > Which leads to my submission:-
> > 
> > 
> > static const uint8_t white[4] = { 255, 255, 255, 255 };
> > static const uint8_t black[4] = {  19,  19,  19, 255 };
> > 
> > /* pluge pulses */
> > static const uint8_t neg4ire[4] = {   9,   9,   9, 255 };
> > static const uint8_t pos4ire[4] = {  29,  29,  29, 255 };
> > 
> > +/* fudged Q/-I */
> > static const uint8_t i_pixel[4] = {   0,  68, 130, 255 };
> > static const uint8_t q_pixel[4] = {  67,   0, 130, 255 };
> > 
> > 
> > 
> > > 
> > > (And I agree if we call it "SMPTE bars" I'd expect the pattern refers
> > > to some standard).
> > ...and as we are fudging some values I think we should say so as per my
> > inline comment above...
> 
> Patch updated against the proposed values. In order to avoid the Q/-I
> color "fudge" we could find some hack to tell ff_draw_color() to
> accept YUV values and convert them to RGB colorspace, but I'm not sure
> I'm willing to do the work...
> -- 
> FFmpeg = Friendly and Forgiving Martial Puristic Elfic Gem

> From dadb5afd57ee0299df6dd456d2d93da4675d417e Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda at gmail.com>
> Date: Wed, 20 Jun 2012 01:54:58 +0000
> Subject: [PATCH] lavfi: add smptebars source
> 
> Patch readapted by Stefano Sabatini, color values proposed by Tim
> Nicholson <nichot20 at yahoo.com>.
[...]

I'm going to push the patch tomorrow if nobody has objections.
Tim?
-- 
FFmpeg = Foolish & Fiendish Multimedia Power Ephemeral Gnome


More information about the ffmpeg-devel mailing list