#define SURFACE_NUM 16 /* 16 surfaces for source YUV */
#define MAX_NUM_REF1 16 // Seemingly a hardware-fixed value, not related to SURFACE_NUM
#define SURFACE_NUM 16 /* 16 surfaces for source YUV */
#define MAX_NUM_REF1 16 // Seemingly a hardware-fixed value, not related to SURFACE_NUM
class QuickSyncEncoderImpl {
public:
QuickSyncEncoderImpl(const std::string &filename, movit::ResourcePool *resource_pool, QSurface *surface, const std::string &va_display, int width, int height, AVOutputFormat *oformat, X264Encoder *x264_encoder, DiskSpaceEstimator *disk_space_estimator);
class QuickSyncEncoderImpl {
public:
QuickSyncEncoderImpl(const std::string &filename, movit::ResourcePool *resource_pool, QSurface *surface, const std::string &va_display, int width, int height, AVOutputFormat *oformat, X264Encoder *x264_encoder, DiskSpaceEstimator *disk_space_estimator);
int build_packed_seq_buffer(movit::YCbCrLumaCoefficients ycbcr_coefficients, unsigned char **header_buffer);
int build_packed_slice_buffer(unsigned char **header_buffer);
int init_va(const std::string &va_display);
int build_packed_seq_buffer(movit::YCbCrLumaCoefficients ycbcr_coefficients, unsigned char **header_buffer);
int build_packed_slice_buffer(unsigned char **header_buffer);
int init_va(const std::string &va_display);
std::map<int, PendingFrame> reorder_buffer;
int quicksync_encoding_frame_num = 0;
std::map<int, PendingFrame> reorder_buffer;
int quicksync_encoding_frame_num = 0;
std::unique_ptr<AudioEncoder> file_audio_encoder;
X264Encoder *x264_encoder; // nullptr if not using x264.
std::unique_ptr<AudioEncoder> file_audio_encoder;
X264Encoder *x264_encoder; // nullptr if not using x264.
VAProfile h264_profile = (VAProfile)~0;
VAConfigAttrib config_attrib[VAConfigAttribTypeMax];
int config_attrib_num = 0, enc_packed_header_idx;
VAProfile h264_profile = (VAProfile)~0;
VAConfigAttrib config_attrib[VAConfigAttribTypeMax];
int config_attrib_num = 0, enc_packed_header_idx;