On 12/01/2011 06:24 PM, Martin Storsjö wrote: > Earlier, bits per sample was defined as 8, which wasn't chosen > with any thought, only chosen since it didn't seem to change > anything compared to not defining it at all. > > g722 encodes 2 samples into one byte codeword, therefore the > bits per sample is 4. By changing this, the generated timestamps > for streams encoded with g722 become correct.
While technically true, this causes problems with WAV. In WAV files, the bits-per-sample field in the header is supposed to be 8 (or 7 or 6) not 4. So we need an override for g722 in the WAV header writing function in lavf to write the correct value. See Bug #54 > Due to the way avcodec_encode_audio is defined for non frame > based codecs, calculating the number of input samples in the > encode function has to be changed once the bits per samples > definition is changed. It isn't defined that way for non-frame-based codecs, it's defined that way for PCM. The g722 encoder is just wrong. All other ADPCM encoders set frame_size and use it accordingly. -Justin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
