[FFmpeg-devel] [PATCH 2/3] lavfi: EBU R.128 channel weights

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Jan 19 09:23:33 CET 2013


David A. Sedacca <sedacca <at> comcast.net> writes:

> > >          /* channel weighting */
> > > + ebur128->ch_weighting[i] = 1.0;
> > > + if (1ULL<<idx_bitposn & AV_CH_LOW_FREQUENCY )
> > > ebur128->ch_weighting[i] = 0;
> > > + if (1ULL<<idx_bitposn & AV_CH_LOW_FREQUENCY_2)
> > > ebur128->ch_weighting[i] = 0;
> > > + if (1ULL<<idx_bitposn & BACK_MASK ) ebur128->ch_weighting[i] =
> > > 1.41;
> > 
> > else if ?
> > 
> > > + idx_bitposn++;
> 
> Clément,
> For the "else if" case, the weighting is left as "1.0", matching
> your description "the rest is unchanged (ch weight = 1)".

I believe he meant:
if (1ULL<<idx_bitposn & AV_CH_LOW_FREQUENCY) {
  ebur128->ch_weighting[i] = 0;
} else if (1ULL<<idx_bitposn & AV_CH_LOW_FREQUENCY_2) {
  ebur128->ch_weighting[i] = 0;
} else if (1ULL<<idx_bitposn & BACK_MASK ) {
  ebur128->ch_weighting[i] = 1.41;
}

(Yes, braces are suggested for every if - else if construct.)
The first two if's could be merged iiuc.

Carl Eugen



More information about the ffmpeg-devel mailing list