#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/codec/codec_test.h"
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "remoting/base/util.h"
#include "remoting/codec/video_decoder.h"
#include "remoting/codec/video_encoder.h"
#include "remoting/proto/video.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
BasicDesktopFrame;
DesktopFrame;
DesktopRect;
DesktopRegion;
DesktopSize;
namespace {
const int kBytesPerPixel = …;
std::vector<DesktopRegion> MakeTestRegionLists(DesktopSize size) { … }
}
namespace remoting {
class VideoDecoderTester { … };
class VideoEncoderTester { … };
std::unique_ptr<DesktopFrame> PrepareFrame(const DesktopSize& size) { … }
static void TestEncodingRects(VideoEncoder* encoder,
VideoEncoderTester* tester,
DesktopFrame* frame,
const DesktopRegion& region) { … }
void TestVideoEncoder(VideoEncoder* encoder, bool strict) { … }
void TestVideoEncoderEmptyFrames(VideoEncoder* encoder, int max_topoff_frames) { … }
static void TestEncodeDecodeRects(VideoEncoder* encoder,
VideoEncoderTester* encoder_tester,
VideoDecoderTester* decoder_tester,
DesktopFrame* frame,
const DesktopRegion& region) { … }
void TestVideoEncoderDecoder(VideoEncoder* encoder,
VideoDecoder* decoder,
bool strict) { … }
static void FillWithGradient(DesktopFrame* frame) { … }
void TestVideoEncoderDecoderGradient(VideoEncoder* encoder,
VideoDecoder* decoder,
const DesktopSize& screen_size,
double max_error_limit,
double mean_error_limit) { … }
}