aboutsummaryrefslogtreecommitdiff
path: root/src/decoder_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_impl.cc')
-rw-r--r--src/decoder_impl.cc44
1 files changed, 34 insertions, 10 deletions
diff --git a/src/decoder_impl.cc b/src/decoder_impl.cc
index e23903c..dbb9e81 100644
--- a/src/decoder_impl.cc
+++ b/src/decoder_impl.cc
@@ -1232,7 +1232,7 @@ StatusCode DecoderImpl::DecodeTiles(
LIBGAV1_DLOG(ERROR, "Failed to allocate memory for the decoder buffer.");
return kStatusOutOfMemory;
}
- if (sequence_header.enable_cdef) {
+ if (frame_header.cdef.bits > 0) {
if (!frame_scratch_buffer->cdef_index.Reset(
DivideBy16(frame_header.rows4x4 + kMaxBlockHeight4x4),
DivideBy16(frame_header.columns4x4 + kMaxBlockWidth4x4),
@@ -1241,6 +1241,15 @@ StatusCode DecoderImpl::DecodeTiles(
return kStatusOutOfMemory;
}
}
+ if (do_cdef) {
+ if (!frame_scratch_buffer->cdef_skip.Reset(
+ DivideBy2(frame_header.rows4x4 + kMaxBlockHeight4x4),
+ DivideBy16(frame_header.columns4x4 + kMaxBlockWidth4x4),
+ /*zero_initialize=*/true)) {
+ LIBGAV1_DLOG(ERROR, "Failed to allocate memory for cdef skip.");
+ return kStatusOutOfMemory;
+ }
+ }
if (!frame_scratch_buffer->inter_transform_sizes.Reset(
frame_header.rows4x4 + kMaxBlockHeight4x4,
frame_header.columns4x4 + kMaxBlockWidth4x4,
@@ -1364,23 +1373,39 @@ StatusCode DecoderImpl::DecodeTiles(
const int pixel_size = sequence_header.color_config.bitdepth == 8
? sizeof(uint8_t)
: sizeof(uint16_t);
+ const int coefficients_size = kSuperResFilterTaps *
+ Align(frame_header.upscaled_width, 16) *
+ pixel_size;
if (!frame_scratch_buffer->superres_coefficients[kPlaneTypeY].Resize(
- kSuperResFilterTaps * Align(frame_header.upscaled_width, 16) *
- pixel_size)) {
+ coefficients_size)) {
LIBGAV1_DLOG(ERROR,
"Failed to Resize superres_coefficients[kPlaneTypeY].");
return kStatusOutOfMemory;
}
+#if LIBGAV1_MSAN
+ // Quiet SuperRes_NEON() msan warnings.
+ memset(frame_scratch_buffer->superres_coefficients[kPlaneTypeY].get(), 0,
+ coefficients_size);
+#endif
+ const int uv_coefficients_size =
+ kSuperResFilterTaps *
+ Align(SubsampledValue(frame_header.upscaled_width, 1), 16) * pixel_size;
if (!sequence_header.color_config.is_monochrome &&
sequence_header.color_config.subsampling_x != 0 &&
!frame_scratch_buffer->superres_coefficients[kPlaneTypeUV].Resize(
- kSuperResFilterTaps *
- Align(SubsampledValue(frame_header.upscaled_width, 1), 16) *
- pixel_size)) {
+ uv_coefficients_size)) {
LIBGAV1_DLOG(ERROR,
"Failed to Resize superres_coefficients[kPlaneTypeUV].");
return kStatusOutOfMemory;
}
+#if LIBGAV1_MSAN
+ if (!sequence_header.color_config.is_monochrome &&
+ sequence_header.color_config.subsampling_x != 0) {
+ // Quiet SuperRes_NEON() msan warnings.
+ memset(frame_scratch_buffer->superres_coefficients[kPlaneTypeUV].get(), 0,
+ uv_coefficients_size);
+ }
+#endif
}
if (do_superres && threading_strategy.post_filter_thread_pool() != nullptr) {
@@ -1405,10 +1430,6 @@ StatusCode DecoderImpl::DecodeTiles(
}
}
- PostFilter post_filter(frame_header, sequence_header, frame_scratch_buffer,
- current_frame->buffer(), dsp,
- settings_.post_filter_mask);
-
if (is_frame_parallel_ && !IsIntraFrame(frame_header.frame_type)) {
// We can parse the current frame if all the reference frames have been
// parsed.
@@ -1477,6 +1498,9 @@ StatusCode DecoderImpl::DecodeTiles(
}
}
+ PostFilter post_filter(frame_header, sequence_header, frame_scratch_buffer,
+ current_frame->buffer(), dsp,
+ settings_.post_filter_mask);
SymbolDecoderContext saved_symbol_decoder_context;
BlockingCounterWithStatus pending_tiles(tile_count);
for (int tile_number = 0; tile_number < tile_count; ++tile_number) {