chromium/media/gpu/vp9_svc_layers_unittest.cc

// Copyright 2023 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/vp9_svc_layers.h"

#include <algorithm>
#include <array>
#include <map>
#include <optional>
#include <vector>

#include "base/containers/contains.h"
#include "base/logging.h"
#include "media/gpu/vp9_picture.h"
#include "media/gpu/vp9_reference_frame_vector.h"
#include "media/parsers/vp9_parser.h"
#include "media/video/video_encode_accelerator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace media {

namespace {

constexpr gfx::Size kDefaultEncodeSize(1280, 720);
constexpr int kSpatialLayerResolutionDenom[] =;

gfx::Size GetDefaultSVCResolution(size_t spatial_index) {}

std::vector<gfx::Size> GetDefaultSVCResolutions(size_t num_spatial_layers) {}

VP9SVCLayers::Config GetDefaultSVCLayers2Config(
    size_t num_spatial_layers,
    size_t num_temporal_layers,
    SVCInterLayerPredMode inter_layer_pred) {}

uint8_t GetTemporalIndex(size_t num_temporal_layers, size_t frame_num) {}

struct Vp9MetadataAndFrameNum {};

void VerifyReferenceFrame(const Vp9Metadata& metadata,
                          size_t frame_num,
                          const Vp9MetadataAndFrameNum& ref_frame,
                          SVCInterLayerPredMode inter_layer_pred) {}

void VerifykSVCFrame(
    const VP9SVCLayers::PictureParam& picture_param,
    const Vp9Metadata& metadata,
    const std::array<Vp9MetadataAndFrameNum, kVp9NumRefFrames>& ref_frames,
    size_t frame_num,
    size_t num_spatial_layers,
    size_t expected_begin_active_layer,
    size_t expected_end_active_layer) {}

void VerifySmodeFrame(
    const VP9SVCLayers::PictureParam& picture_param,
    const Vp9Metadata& metadata,
    const std::array<Vp9MetadataAndFrameNum, kVp9NumRefFrames>& ref_frames,
    size_t frame_num,
    size_t num_spatial_layers,
    size_t expected_begin_active_layer,
    size_t expected_end_active_layer) {}
}  // namespace

class VP9SVCLayersTest
    : public ::testing::TestWithParam<
          ::testing::tuple<size_t, size_t, SVCInterLayerPredMode>> {};

TEST_P(VP9SVCLayersTest, VerifyMetadata) {}

TEST_P(VP9SVCLayersTest, VerifyMetadataMultipleTimes) {}

// std::make_tuple(num_spatial_layers, num_temporal_layers,
// inter_layer_pred_mode)
INSTANTIATE_TEST_SUITE_P();
}  // namespace media