"src/diffusers/schedulers/scheduling_unipc_multistep.py" did not exist on "a0520193e15951655ee2c08c24bfdca716f6f64c"
encoder.h 706 Bytes
Newer Older
1
2
#pragma once

3
4
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/filter_graph.h>
5
6
7
8
9
10
11
12
13
14
#include <torch/types.h>

namespace torchaudio::io {

// Encoder + Muxer
class Encoder {
  // Reference to the AVFormatContext (muxer)
  AVFormatContext* format_ctx;
  // Reference to codec context (encoder)
  AVCodecContext* codec_ctx;
15
  // Stream object as reference. Owned by AVFormatContext.
16
17
18
  AVStream* stream;
  // Temporary object used during the encoding
  // Encoder owns it.
19
  AVPacketPtr packet{alloc_avpacket()};
20
21

 public:
22
23
24
25
  Encoder(
      AVFormatContext* format_ctx,
      AVCodecContext* codec_ctx,
      AVStream* stream) noexcept;
26
27
28
29
30

  void encode(AVFrame* frame);
};

} // namespace torchaudio::io