#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/vaapi/test/h264_decoder.h"
#include <va/va.h>
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "media/base/subsample_entry.h"
#include "media/gpu/macros.h"
#include "media/gpu/vaapi/test/h264_dpb.h"
#include "media/gpu/vaapi/test/video_decoder.h"
#include "media/parsers/h264_parser.h"
namespace media::vaapi_test {
namespace {
struct PicNumDescCompare { … };
struct LongTermPicNumAscCompare { … };
struct POCAscCompare { … };
struct POCDescCompare { … };
bool FillH264PictureFromSliceHeader(const H264SPS* sps,
const H264SliceHeader& slice_hdr,
H264Picture* pic) { … }
}
H264Decoder::H264Decoder(const uint8_t* stream_data,
size_t stream_len,
const VaapiDevice& va_device,
SharedVASurface::FetchPolicy fetch_policy)
: … { … }
H264Decoder::~H264Decoder() { … }
VideoDecoder::Result H264Decoder::DecodeNextFrame() { … }
void H264Decoder::DecodeNextFrameInStream() { … }
void H264Decoder::ProcessSlice() { … }
void H264Decoder::UpdateSequenceParams() { … }
void H264Decoder::UpdatePictureParams() { … }
void H264Decoder::DecodeFrame() { … }
void H264Decoder::FinishPicture(scoped_refptr<H264Picture> pic) { … }
bool H264Decoder::GetStreamMetadata() { … }
bool H264Decoder::IsNewFrame() { … }
void H264Decoder::ExtractSliceHeader() { … }
void H264Decoder::StartNewFrame() { … }
bool H264Decoder::InitCurrPicture(const H264SliceHeader* slice_hdr) { … }
void H264Decoder::ConstructReferencePicListsP() { … }
void H264Decoder::ConstructReferencePicListsB() { … }
void H264Decoder::UpdatePicNums(int frame_num) { … }
bool H264Decoder::InitNonexistingPicture(scoped_refptr<H264Picture> pic,
int frame_num,
bool ref) { … }
bool H264Decoder::HandleFrameNumGap(int frame_num) { … }
bool H264Decoder::CalculatePicOrderCounts(scoped_refptr<H264Picture> pic) { … }
void H264Decoder::UpdateMaxNumReorderFrames(const H264SPS* sps) { … }
bool H264Decoder::ModifyReferencePicLists(const H264SliceHeader* slice_hdr,
H264Picture::Vector* ref_pic_list0,
H264Picture::Vector* ref_pic_list1) { … }
bool H264Decoder::ModifyReferencePicList(const H264SliceHeader* slice_hdr,
int list,
H264Picture::Vector* ref_pic_listx) { … }
bool H264Decoder::ReferencePictureMarking(scoped_refptr<H264Picture> pic) { … }
bool H264Decoder::HandleMemoryManagementOps(scoped_refptr<H264Picture> pic) { … }
bool H264Decoder::SlidingWindowPictureMarking() { … }
int H264Decoder::PicNumF(const H264Picture& pic) const { … }
int H264Decoder::LongTermPicNumF(const H264Picture& pic) const { … }
void H264Decoder::ShiftRightAndInsert(H264Picture::Vector* v,
int from,
int to,
scoped_refptr<H264Picture> pic) { … }
uint32_t H264Decoder::H264LevelToMaxDpbMbs(uint8_t level) { … }
void H264Decoder::FlushDPB() { … }
}