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

Stefano Sabatini stefasab at gmail.com
Tue Aug 7 20:19:41 CEST 2012


On date Monday 2012-08-06 09:57:28 +0100, Tim Nicholson encoded:
> On 06/08/12 09:32, Stefano Sabatini wrote:
> > 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?
> > 
> 
> Fine by me.

Patch pushed.

> BTW I now have a copy of the latest SMPTE spec for the SD/HD bars, so I
> will see what it will take to implement them since they will be
> potentially more useful. However I am about to go on my holidays so it
> will be a while and I don't want to hold things up anymore...

Allright. This could be implemented as a smptebars option or as an
entirely new source.
-- 
FFmpeg = Fantastic & Faithful Magnificient Ponderous Elastic Geek


More information about the ffmpeg-devel mailing list