decoder_impl: Remove AllocateCurrentFrame
AllocateCurrentFrame is a two line function and has only one caller.
Simply inline the body in the caller.
PiperOrigin-RevId: 317813793
Change-Id: I075657967c048c011945b9cd8722baf580c07958
diff --git a/src/decoder_impl.cc b/src/decoder_impl.cc
index 921c2e4..91ed353 100644
--- a/src/decoder_impl.cc
+++ b/src/decoder_impl.cc
@@ -635,20 +635,6 @@
return kStatusOk;
}
-bool DecoderImpl::AllocateCurrentFrame(RefCountedBuffer* const current_frame,
- const ColorConfig& color_config,
- const ObuFrameHeader& frame_header,
- int left_border, int right_border,
- int top_border, int bottom_border) {
- current_frame->set_chroma_sample_position(
- color_config.chroma_sample_position);
- return current_frame->Realloc(
- color_config.bitdepth, color_config.is_monochrome,
- frame_header.upscaled_width, frame_header.height,
- color_config.subsampling_x, color_config.subsampling_y, left_border,
- right_border, top_border, bottom_border);
-}
-
StatusCode DecoderImpl::CopyFrameToOutputBuffer(
const RefCountedBufferPtr& frame) {
YuvBuffer* yuv_buffer = frame->buffer();
@@ -745,9 +731,16 @@
frame_scratch_buffer->threading_strategy.post_filter_thread_pool() ==
nullptr,
sequence_header.color_config.subsampling_y);
- if (!AllocateCurrentFrame(current_frame, sequence_header.color_config,
- frame_header, kBorderPixels, kBorderPixels,
- kBorderPixels, bottom_border)) {
+ current_frame->set_chroma_sample_position(
+ sequence_header.color_config.chroma_sample_position);
+ if (!current_frame->Realloc(sequence_header.color_config.bitdepth,
+ sequence_header.color_config.is_monochrome,
+ frame_header.upscaled_width, frame_header.height,
+ sequence_header.color_config.subsampling_x,
+ sequence_header.color_config.subsampling_y,
+ /*left_border=*/kBorderPixels,
+ /*right_border=*/kBorderPixels,
+ /*top_border=*/kBorderPixels, bottom_border)) {
LIBGAV1_DLOG(ERROR, "Failed to allocate memory for the decoder buffer.");
return kStatusOutOfMemory;
}
diff --git a/src/decoder_impl.h b/src/decoder_impl.h
index e8b4041..d216b83 100644
--- a/src/decoder_impl.h
+++ b/src/decoder_impl.h
@@ -170,11 +170,6 @@
// EnqueueFrame() and DequeueFrame()).
StatusCode SignalFailure(StatusCode status);
- bool AllocateCurrentFrame(RefCountedBuffer* current_frame,
- const ColorConfig& color_config,
- const ObuFrameHeader& frame_header, int left_border,
- int right_border, int top_border,
- int bottom_border);
void ReleaseOutputFrame();
// Decodes all the frames contained in the given temporal unit. Used only in