[email protected] (Niels Möller) writes: > Maybe there's also an X96 extension in the stream, I'll have to check. > Otherwise, the core data has to be up-sampled in some unspecified way > before the residual can be added to it.
As far as I can tell, there's no X96 data. So upsampling is required. To get it truly lossless, this obviously have to be done exactly as it was done on the encoder side, which is unspecified. But if I postpone bitexact output for later, what type of up-sampling filter is reasonable? I checked wikipedia, which suggests using a "half-band" filter, but I have no idea what filter order is needed to get reasonable quality. Also, in general, it's not really possible to do correct up-sampling independently for each frame, one would need a little history from the previous frame in order to apply the filter. But in this case doing it without inter-frame history could work, if the encoder did it the same way, so that the errors are taken into acocunt in the residual signal. The residual must also compensate for the time delay that is inevitable when using a causal low-pass filter, which probably means that it's no point in using a high-order filter with very sharp cutoff. It could even work to do trivial upsampling by simply repeating each input sample twice (i.e., convert 1, 2, 3 to 1, 1, 2, 2, 3, 3, rather than proper upsampling which produces a low-pass filtered version of 1, 0, 2, 0, 3, 0). Is there any reasonable up-sampling filter elsewhere in libav which I could use? In the spec, there's also an nFsInterpolate value, described as nFsInterpolate (sampling frequency modifier) This specifies the sampling rate interpolation factor of the original signal. The sampling rate adjustment when mixing channel sets with different sampling rates, it specifies the interpolation factor applied to the original sampling frequency. This 2-bit code (see Table 8-6) encodes the Mvalue or Interpolation factor applied to the original sampling frequency. In the test stream, this is zero, corresponding to Mvalue=1. It's not clear to me whether or not this is related to the adding of the xll residual channel to the core channels. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
