Refactor the initialization of EncodeProcess (#3205)
Summary: Pull Request resolved: https://github.com/pytorch/audio/pull/3205 This commit refactors the initialization of EncodeProcess. Interface-wise, the signature of the constructor of EncodeProcess has made simpler just to take rvalues of its components, and the initialization of the components have been moved to helper functions. Implementat-wise, the order that the components are initialized is revised, and the source of initialization parameters is also revised. For example, the original implementation first creates AVCodecContext, and passes it around to create the other components. This relied on an assumption that parameters AVCodecContext has (such as image size and sample rate) are same as the source data. This is not always right, and as we will introduce custom filter graph and allow on-the-fly transform of rates and dimensions, it will become even less correct. The new initialization constructs source AVFrame, TensorConverter and Filte...
Showing
Please register or sign in to comment