#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/vaapi/test/h264_vaapi_wrapper.h"
#include <va/va.h>
#include <algorithm>
#include <memory>
#include "base/trace_event/trace_event.h"
#include "media/gpu/macros.h"
#include "media/gpu/vaapi/test/h264_dpb.h"
#include "media/gpu/vaapi/test/macros.h"
#include "media/gpu/vaapi/test/scoped_va_config.h"
#include "media/gpu/vaapi/test/scoped_va_context.h"
#include "media/gpu/vaapi/test/shared_va_surface.h"
#include "media/gpu/vaapi/test/vaapi_device.h"
#include "media/parsers/h264_parser.h"
namespace media::vaapi_test {
namespace {
static constexpr int kZigzagScan4x4[16] = …;
static constexpr uint8_t kZigzagScan8x8[64] = …;
VAProfile GetProfile(const H264SPS* sps) { … }
unsigned int GetFormatForProfile(const VAProfile& profile) { … }
void InitVAPicture(VAPictureH264* va_pic) { … }
void FillVAPicture(VAPictureH264* va_pic, scoped_refptr<H264Picture> pic) { … }
}
H264VaapiWrapper::H264VaapiWrapper(const VaapiDevice& va_device)
: … { … }
H264VaapiWrapper::~H264VaapiWrapper() = default;
scoped_refptr<H264Picture> H264VaapiWrapper::CreatePicture(const H264SPS* sps) { … }
void H264VaapiWrapper::SubmitFrameMetadata(
const H264SPS* sps,
const H264PPS* pps,
const H264DPB& dpb,
const H264Picture::Vector& ref_pic_listp0,
const H264Picture::Vector& ref_pic_listb0,
const H264Picture::Vector& ref_pic_listb1,
scoped_refptr<H264Picture> pic) { … }
void H264VaapiWrapper::SubmitSlice(
const H264PPS* pps,
const H264SliceHeader* slice_hdr,
const H264Picture::Vector& ref_pic_list0,
const H264Picture::Vector& ref_pic_list1,
scoped_refptr<H264Picture> pic,
const uint8_t* data,
size_t size,
const std::vector<SubsampleEntry>& subsamples) { … }
void H264VaapiWrapper::SubmitDecode(scoped_refptr<H264Picture> pic) { … }
}