chromium/media/gpu/vaapi/test/h264_decoder.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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) {}

}  // namespace

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() {}

// H264 does not guarantee frames appear in the order they need to be shown in.
// This method merely decodes the next frame in the stream, it's up to the
// caller to actually figure out how to order them.
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) {}

// This method ensures that DPB does not overflow, either by removing
// reference pictures as specified in the stream, or using a sliding window
// procedure to remove the oldest one.
// It also performs marking and unmarking pictures as reference.
// See spac 8.2.5.1.
bool H264Decoder::ReferencePictureMarking(scoped_refptr<H264Picture> pic) {}

bool H264Decoder::HandleMemoryManagementOps(scoped_refptr<H264Picture> pic) {}

bool H264Decoder::SlidingWindowPictureMarking() {}

// See 8.2.4
int H264Decoder::PicNumF(const H264Picture& pic) const {}

// See 8.2.4
int H264Decoder::LongTermPicNumF(const H264Picture& pic) const {}

// Shift elements on the |v| starting from |from| to |to|, inclusive,
// one position to the right and insert pic at |from|.
void H264Decoder::ShiftRightAndInsert(H264Picture::Vector* v,
                                      int from,
                                      int to,
                                      scoped_refptr<H264Picture> pic) {}

uint32_t H264Decoder::H264LevelToMaxDpbMbs(uint8_t level) {}

void H264Decoder::FlushDPB() {}

}  // namespace media::vaapi_test