lavf: move internal functions from avformat.h to internal.h