Add or clean up comments related to denoising
aom/aom_encoder.h: Document that aom_codec_encode() modifies the samples
in img->planes[i] if denoise-noise-level is nonzero, even though the img
input parameter is declared as a const pointer.
Use "param[in,out]" instead of "param[in/out]" in Doxygen comments.
https://www.doxygen.nl/manual/commands.html#cmdparam says:
When a parameter is both input and output, [in,out] is used as
attribute.
Document that the `sd` parameter of av1_receive_raw_frame() is both an
input and output.
The apply_denoise parameter of aom_denoise_and_model_run() should be
documented as an input.
Add a TODO comment to aom_denoise_and_model_run() because it assumes
sd->u_buffer and sd->v_buffer are not null pointers, so it doesn't
handle monochrome frames correctly.
Change-Id: Ie6eef41d7416e73a8d823cecabc0f9a840b220b7
diff --git a/aom/aom_encoder.h b/aom/aom_encoder.h
index c0efe79..87adb98 100644
--- a/aom/aom_encoder.h
+++ b/aom/aom_encoder.h
@@ -1024,6 +1024,10 @@
* \param[in] img Image data to encode, NULL to flush.
* Encoding sample values outside the range
* [0..(1<<img->bit_depth)-1] is undefined behavior.
+ * Note: Although img is declared as a const pointer,
+ * if AV1E_SET_DENOISE_NOISE_LEVEL is set to a nonzero
+ * value aom_codec_encode() modifies (denoises) the
+ * samples in img->planes[i] .
* \param[in] pts Presentation time stamp, in timebase units. If img
* is NULL, pts is ignored.
* \param[in] duration Duration to show frame, in timebase units. If img
diff --git a/aom_dsp/grain_table.h b/aom_dsp/grain_table.h
index 3f75101..49e8498 100644
--- a/aom_dsp/grain_table.h
+++ b/aom_dsp/grain_table.h
@@ -52,7 +52,7 @@
/*!\brief Add a mapping from [time_stamp, end_time) to the given grain
* parameters
*
- * \param[in/out] table The grain table
+ * \param[in,out] table The grain table
* \param[in] time_stamp The start time stamp
* \param[in] end_stamp The end time_stamp
* \param[in] grain The grain parameters
diff --git a/aom_dsp/noise_model.c b/aom_dsp/noise_model.c
index 531ba5b..eae3cc6 100644
--- a/aom_dsp/noise_model.c
+++ b/aom_dsp/noise_model.c
@@ -1617,6 +1617,8 @@
return 1;
}
+// TODO(aomedia:3151): Handle a monochrome image (sd->u_buffer and sd->v_buffer
+// are null pointers) correctly.
int aom_denoise_and_model_run(struct aom_denoise_and_model_t *ctx,
YV12_BUFFER_CONFIG *sd,
aom_film_grain_t *film_grain, int apply_denoise) {
diff --git a/aom_dsp/noise_model.h b/aom_dsp/noise_model.h
index f385251..8228aea 100644
--- a/aom_dsp/noise_model.h
+++ b/aom_dsp/noise_model.h
@@ -293,13 +293,13 @@
* parameter will be true when the input buffer was successfully denoised and
* grain was modelled. Returns false on error.
*
- * \param[in] ctx Struct allocated with
+ * \param[in] ctx Struct allocated with
* aom_denoise_and_model_alloc that holds some
* buffers for denoising and the current noise
* estimate.
- * \param[in/out] buf The raw input buffer to be denoised.
+ * \param[in,out] buf The raw input buffer to be denoised.
* \param[out] grain Output film grain parameters
- * \param[out] apply_denoise Whether or not to apply the denoising to the
+ * \param[in] apply_denoise Whether or not to apply the denoising to the
* frame that will be encoded
*/
int aom_denoise_and_model_run(struct aom_denoise_and_model_t *ctx,
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index a95ea25..8030b2a 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -3617,11 +3617,11 @@
* \ingroup high_level_algo
* This function receives the raw frame data from input.
*
- * \param[in] cpi Top-level encoder structure
- * \param[in] frame_flags Flags to decide how to encoding the frame
- * \param[in] sd Contain raw frame data
- * \param[in] time_stamp Time stamp of the frame
- * \param[in] end_time_stamp End time stamp
+ * \param[in] cpi Top-level encoder structure
+ * \param[in] frame_flags Flags to decide how to encoding the frame
+ * \param[in,out] sd Contain raw frame data
+ * \param[in] time_stamp Time stamp of the frame
+ * \param[in] end_time_stamp End time stamp
*
* \return Returns a value to indicate if the frame data is received
* successfully.