Commit 32a4974b authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Roll src/third_party/libgav1/src/ 25dc90ee0..8e8c13b9e (55 commits)

https://chromium.googlesource.com/codecs/libgav1.git/+log/25dc90ee0776..8e8c13b9e821

$ git log 25dc90ee0..8e8c13b9e --date=short --no-merges --format='%ad %ae %s'
2020-02-17 wtc Remove aligned_width() and aligned_height().
2020-02-16 wtc Change aligned_height to current_process_unit_heig
2020-02-15 johannkoenig arm: do multiple ConvolveCopy rows at once
2020-02-14 johannkoenig warp: take into account warp ranges
2020-02-14 wtc Use uintptr_t instead of size_t in AlignAddr().
2020-02-14 wtc Add ComputeFrameBufferInfo() and SetFrameBuffer().
2020-02-14 vigneshv tile: Generalize DecodeSuperBlockRow
2020-02-14 vigneshv Re-use loop restoration info across frames
2020-02-14 johannkoenig prediction: remove offsets for bitdepth == 8
2020-02-14 slavarnway x86: Add Adst8 dc only support
(...)
2020-02-03 johannkoenig cleanup: use constants for bitdepth
2020-02-03 johannkoenig convolve: ensure no accidental copies
2020-02-03 wtc Add a C API.
2020-02-03 johannkoenig arm: remove inter_round_bits from warp
2020-02-03 johannkoenig dsp: remove inter_round_bits_vertical
2020-02-03 johannkoenig warp: rename is_clip to is_compound
2020-02-03 linfengz trivial: remove pos_index in Tile::ReadSignAndApplyDequantization
2020-02-03 linfengz reduce quantized coefficient padding
2020-02-03 linfengz trivial: update DaalaBitReader::ReadLiteral()
2020-02-03 wtc Declare local var 'v1_callbacks' right before use.

Created with:
  roll-dep src/third_party/libgav1/src

Convert the FormatVideoFrame() method to a non-member function in the
unnamed namespace in gav1_video_decoder.cc. This avoids the forward
declaration of the libgav1::DecoderBuffer type in gav1_video_decoder.h.
It is tricky to forward-declare libgav1::DecoderBuffer because it is now
a type alias, not a struct.

Add the "libgav1_dsp" source_set to work around having two files named
film_grain.cc.

Tested:
  $ gn args out/Default
  # In the editor, add the following build argument:
  # enable_libgav1_decoder = true
  $ autoninja -C out/Default media_unittests
  $ out/Default/media_unittests
  $ out/Default/media_unittests --enable-features=Gav1VideoDecoder

R=tomfinegan@chromium.org,johannkoenig@google.com,jzern@google.com

Bug: 1026522
Change-Id: I6db24dd117083665d24453c8b69c00424b625869
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066137Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarJohann Koenig <johannkoenig@google.com>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#743335}
parent 3c046694
......@@ -939,7 +939,7 @@ deps = {
Var('chromium_git') + '/external/github.com/google/emoji-segmenter.git' + '@' + Var('emoji_segmenter_revision'),
'src/third_party/libgav1/src':
Var('chromium_git') + '/codecs/libgav1.git' + '@' + '25dc90ee07763b13db1be14e1f2afadc6894c9f3',
Var('chromium_git') + '/codecs/libgav1.git' + '@' + '8e8c13b9e821f4590761487c4e0b96f432eaf051',
'src/third_party/glslang/src':
Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + 'c12493ff69e21800fb08b6d6e92eb0b9c5cb5efb',
......
......@@ -130,6 +130,44 @@ int ReleaseFrameBufferImpl(void* private_data,
return 0;
}
scoped_refptr<VideoFrame> FormatVideoFrame(
const libgav1::DecoderBuffer& buffer,
const gfx::Size& natural_size,
const VideoColorSpace& container_color_space,
FrameBufferPool* memory_pool) {
gfx::Size coded_size(buffer.stride[0], buffer.displayed_height[0]);
gfx::Rect visible_rect(buffer.displayed_width[0], buffer.displayed_height[0]);
auto frame = VideoFrame::WrapExternalYuvData(
Libgav1ImageFormatToVideoPixelFormat(buffer.image_format,
buffer.bitdepth),
coded_size, visible_rect, natural_size, buffer.stride[0],
buffer.stride[1], buffer.stride[2], buffer.plane[0], buffer.plane[1],
buffer.plane[2],
base::TimeDelta::FromMicroseconds(buffer.user_private_data));
// AV1 color space defines match ISO 23001-8:2016 via ISO/IEC 23091-4/ITU-T
// H.273. https://aomediacodec.github.io/av1-spec/#color-config-semantics
media::VideoColorSpace color_space(
buffer.color_primary, buffer.transfer_characteristics,
buffer.matrix_coefficients,
buffer.color_range == libgav1::kColorRangeStudio
? gfx::ColorSpace::RangeID::LIMITED
: gfx::ColorSpace::RangeID::FULL);
// If the frame doesn't specify a color space, use the container's.
if (!color_space.IsSpecified())
color_space = container_color_space;
frame->set_color_space(color_space.ToGfxColorSpace());
frame->metadata()->SetBoolean(VideoFrameMetadata::POWER_EFFICIENT, false);
// Ensure the frame memory is returned to the MemoryPool upon discard.
frame->AddDestructionObserver(
memory_pool->CreateFrameCallback(buffer.buffer_private_data));
return frame;
}
} // namespace
Gav1VideoDecoder::DecodeRequest::DecodeRequest(
......@@ -342,7 +380,8 @@ bool Gav1VideoDecoder::MaybeDequeueFrames() {
return false;
}
scoped_refptr<VideoFrame> frame = FormatVideoFrame(*buffer);
scoped_refptr<VideoFrame> frame = FormatVideoFrame(
*buffer, natural_size_, color_space_, memory_pool_.get());
if (!frame) {
MEDIA_LOG(ERROR, media_log_) << "Failed formatting VideoFrame from "
<< "libgav1::DecoderBuffer";
......@@ -362,40 +401,4 @@ bool Gav1VideoDecoder::MaybeDequeueFrames() {
return true;
}
scoped_refptr<VideoFrame> Gav1VideoDecoder::FormatVideoFrame(
const libgav1::DecoderBuffer& buffer) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
gfx::Size coded_size(buffer.stride[0], buffer.displayed_height[0]);
gfx::Rect visible_rect(buffer.displayed_width[0], buffer.displayed_height[0]);
auto frame = VideoFrame::WrapExternalYuvData(
Libgav1ImageFormatToVideoPixelFormat(buffer.image_format,
buffer.bitdepth),
coded_size, visible_rect, natural_size_, buffer.stride[0],
buffer.stride[1], buffer.stride[2], buffer.plane[0], buffer.plane[1],
buffer.plane[2],
base::TimeDelta::FromMicroseconds(buffer.user_private_data));
// AV1 color space defines match ISO 23001-8:2016 via ISO/IEC 23091-4/ITU-T
// H.273. https://aomediacodec.github.io/av1-spec/#color-config-semantics
media::VideoColorSpace color_space(
buffer.color_primary, buffer.transfer_characteristics,
buffer.matrix_coefficients,
buffer.color_range == libgav1::kColorRangeStudio
? gfx::ColorSpace::RangeID::LIMITED
: gfx::ColorSpace::RangeID::FULL);
// If the frame doesn't specify a color space, use the container's.
if (!color_space.IsSpecified())
color_space = color_space_;
frame->set_color_space(color_space.ToGfxColorSpace());
frame->metadata()->SetBoolean(VideoFrameMetadata::POWER_EFFICIENT, false);
// Ensure the frame memory is returned to the MemoryPool upon discard.
frame->AddDestructionObserver(
memory_pool_->CreateFrameCallback(buffer.buffer_private_data));
return frame;
}
} // namespace media
......@@ -20,12 +20,10 @@
namespace libgav1 {
class Decoder;
struct DecoderBuffer;
} // namespace libgav1
namespace media {
class MediaLog;
class VideoFrame;
class FrameBufferPool;
class MEDIA_EXPORT Gav1VideoDecoder : public OffloadableVideoDecoder {
......@@ -74,8 +72,6 @@ class MEDIA_EXPORT Gav1VideoDecoder : public OffloadableVideoDecoder {
void SetError();
bool EnqueueRequest(DecodeRequest request);
bool MaybeDequeueFrames();
scoped_refptr<VideoFrame> FormatVideoFrame(
const libgav1::DecoderBuffer& buffer);
// Used to report error messages to the client.
MediaLog* const media_log_;
......
......@@ -22,7 +22,7 @@ config("public_libgav1_config") {
if (enable_libgav1_decoder) {
# Separate from libgav1 because utils/constants.cc and dsp/constants.cc
# generate the same object file, constants.o.
source_set("libgav1_util") {
source_set("libgav1_utils") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
......@@ -30,15 +30,28 @@ if (enable_libgav1_decoder) {
sources = gav1_utils_sources
}
# Separate from libgav1 because film_grain.cc and dsp/film_grain.cc
# generate the same object file, film_grain.o.
source_set("libgav1_dsp") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":public_libgav1_config" ]
sources = gav1_dsp_sources
}
static_library("libgav1") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":public_libgav1_config" ]
public_deps = [ ":libgav1_util" ]
public_deps = [
":libgav1_dsp",
":libgav1_utils",
]
sources = gav1_common_sources
sources += gav1_dsp_sources
sources += gav1_gav1_sources
sources += gav1_tile_sources
}
......
......@@ -2,9 +2,9 @@ Name: libgav1
Short Name: libgav1
URL: https://chromium.googlesource.com/codecs/libgav1/
Version: 0
Date: Saturday February 01 2020
Date: Tuesday February 18 2020
Branch: master
Commit: 25dc90ee07763b13db1be14e1f2afadc6894c9f3
Commit: 8e8c13b9e821f4590761487c4e0b96f432eaf051
License: Apache 2.0
License File: libgav1/LICENSE
Security Critical: yes
......
......@@ -6,11 +6,14 @@ gav1_common_sources = [
"//third_party/libgav1/src/src/decoder.cc",
"//third_party/libgav1/src/src/decoder_impl.cc",
"//third_party/libgav1/src/src/decoder_impl.h",
"//third_party/libgav1/src/src/decoder_scratch_buffer.cc",
"//third_party/libgav1/src/src/decoder_scratch_buffer.h",
"//third_party/libgav1/src/src/decoder_settings.cc",
"//third_party/libgav1/src/src/film_grain.cc",
"//third_party/libgav1/src/src/film_grain.h",
"//third_party/libgav1/src/src/frame_buffer.cc",
"//third_party/libgav1/src/src/frame_buffer_callback_adaptor.cc",
"//third_party/libgav1/src/src/frame_buffer_callback_adaptor.h",
"//third_party/libgav1/src/src/frame_buffer_utils.h",
"//third_party/libgav1/src/src/frame_scratch_buffer.h",
"//third_party/libgav1/src/src/internal_frame_buffer_list.cc",
"//third_party/libgav1/src/src/internal_frame_buffer_list.h",
"//third_party/libgav1/src/src/loop_filter_mask.cc",
......@@ -96,7 +99,7 @@ gav1_dsp_sources = [
"//third_party/libgav1/src/src/dsp/dsp.h",
"//third_party/libgav1/src/src/dsp/film_grain.cc",
"//third_party/libgav1/src/src/dsp/film_grain.h",
"//third_party/libgav1/src/src/dsp/film_grain_impl.h",
"//third_party/libgav1/src/src/dsp/film_grain_common.h",
"//third_party/libgav1/src/src/dsp/intra_edge.cc",
"//third_party/libgav1/src/src/dsp/intra_edge.h",
"//third_party/libgav1/src/src/dsp/intrapred.cc",
......@@ -168,6 +171,8 @@ gav1_tile_sources = [
"//third_party/libgav1/src/src/tile/bitstream/transform_size.cc",
"//third_party/libgav1/src/src/tile/prediction.cc",
"//third_party/libgav1/src/src/tile/tile.cc",
"//third_party/libgav1/src/src/tile_scratch_buffer.cc",
"//third_party/libgav1/src/src/tile_scratch_buffer.h",
]
gav1_utils_sources = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment