diff mbox series

[FFmpeg-devel,1/3] - libavcodec/aom_film_grain: Handle byte alignment when multiple film grain parameters sets are present in the bitstream

Message ID F9FF1AC6-F973-4A40-8C80-D297760F3521@amazon.com
State New
Headers show
Series [FFmpeg-devel,1/3] - libavcodec/aom_film_grain: Handle byte alignment when multiple film grain parameters sets are present in the bitstream | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Segall, Andrew via ffmpeg-devel Sept. 20, 2024, 12:42 a.m. UTC
More info: Series of patches to align the implementation of aom_film_grain.c with the AOM specification.

First time committing.  Suggestions very welcome.

Signed-off-by: Andrew Segall <asegall@amazon.com <mailto:asegall@amazon.com>>
---
libavcodec/aom_film_grain.c | 12 ++++++++++++
1 file changed, 12 insertions(+)



apply_units_log2 = get_bits(gb, 4);
fgp->width = get_bits(gb, 12) << apply_units_log2;

Comments

Michael Niedermayer Sept. 20, 2024, 10:06 a.m. UTC | #1
On Fri, Sep 20, 2024 at 12:42:47AM +0000, Segall, Andrew via ffmpeg-devel wrote:
> More info: Series of patches to align the implementation of aom_film_grain.c with the AOM specification.
> 
> First time committing.  Suggestions very welcome.
> 
> Signed-off-by: Andrew Segall <asegall@amazon.com <mailto:asegall@amazon.com>>
> ---
> libavcodec/aom_film_grain.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
> 
> 
> diff --git a/libavcodec/aom_film_grain.c b/libavcodec/aom_film_grain.c
> index e302567ba5..fdfa3dbf77 100644
> --- a/libavcodec/aom_film_grain.c
> +++ b/libavcodec/aom_film_grain.c
> @@ -151,12 +151,24 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
> 
> 
> fgp->type = get_bits1(gb) ? AV_FILM_GRAIN_PARAMS_AV1 : AV_FILM_GRAIN_PARAMS_NONE;
> if (!fgp->type)
> + {
> + payload_bits = get_bits_count(gb) - start_position;
> + if (payload_bits > payload_size * 8)
> + goto error;
> + skip_bits(gb, payload_size * 8 - payload_bits);
> continue;
> + }

patch is corrupted by linebreaks / wordwrap, check youe MUA/editor settings

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/aom_film_grain.c b/libavcodec/aom_film_grain.c
index e302567ba5..fdfa3dbf77 100644
--- a/libavcodec/aom_film_grain.c
+++ b/libavcodec/aom_film_grain.c
@@ -151,12 +151,24 @@  int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,


fgp->type = get_bits1(gb) ? AV_FILM_GRAIN_PARAMS_AV1 : AV_FILM_GRAIN_PARAMS_NONE;
if (!fgp->type)
+ {
+ payload_bits = get_bits_count(gb) - start_position;
+ if (payload_bits > payload_size * 8)
+ goto error;
+ skip_bits(gb, payload_size * 8 - payload_bits);
continue;
+ }


fgp->seed = get_bits(gb, 16);
update_grain = get_bits1(gb);
if (!update_grain)
+ {
+ payload_bits = get_bits_count(gb) - start_position;
+ if (payload_bits > payload_size * 8)
+ goto error;
+ skip_bits(gb, payload_size * 8 - payload_bits);
continue;
+ }