diff mbox series

[FFmpeg-devel,01/12] avcodec/h2645_parse: Remove H2645NAL.rbsp_buffer

Message ID AM7PR03MB6660EDC310C3E684EDC6EF1F8F729@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit c22a9ece2e7d823507b81e7fe7789545f01e7c88
Headers show
Series [FFmpeg-devel,01/12] avcodec/h2645_parse: Remove H2645NAL.rbsp_buffer | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 11, 2021, 6:37 p.m. UTC
Forgotten in 03b82b3ab9883cef017e513c7d0b3b986b3b3e7b.

(Moving data to the front is only done to make existing
initializations like H2645NAL nal = { NULL } not emit int->pointer
conversion warnings.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h2645_parse.c | 3 +--
 libavcodec/h2645_parse.h | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Andreas Rheinhardt Dec. 15, 2021, 3:56 p.m. UTC | #1
Andreas Rheinhardt:
> Forgotten in 03b82b3ab9883cef017e513c7d0b3b986b3b3e7b.
> 
> (Moving data to the front is only done to make existing
> initializations like H2645NAL nal = { NULL } not emit int->pointer
> conversion warnings.)
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/h2645_parse.c | 3 +--
>  libavcodec/h2645_parse.h | 4 +---
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
> index 6fbe97ad4a..03780680c6 100644
> --- a/libavcodec/h2645_parse.c
> +++ b/libavcodec/h2645_parse.c
> @@ -92,8 +92,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
>      } else if (i > length)
>          i = length;
>  
> -    nal->rbsp_buffer = &rbsp->rbsp_buffer[rbsp->rbsp_buffer_size];
> -    dst = nal->rbsp_buffer;
> +    dst = &rbsp->rbsp_buffer[rbsp->rbsp_buffer_size];
>  
>      memcpy(dst, src, i);
>      si = di = i;
> diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h
> index 20a9d355f2..3a13ba248a 100644
> --- a/libavcodec/h2645_parse.h
> +++ b/libavcodec/h2645_parse.h
> @@ -32,10 +32,8 @@
>  #define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes
>  
>  typedef struct H2645NAL {
> -    uint8_t *rbsp_buffer;
> -
> -    int size;
>      const uint8_t *data;
> +    int size;
>  
>      /**
>       * Size, in bits, of just the data, excluding the stop bit and any trailing
> 

Will apply this patchset tonight unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 6fbe97ad4a..03780680c6 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -92,8 +92,7 @@  int ff_h2645_extract_rbsp(const uint8_t *src, int length,
     } else if (i > length)
         i = length;
 
-    nal->rbsp_buffer = &rbsp->rbsp_buffer[rbsp->rbsp_buffer_size];
-    dst = nal->rbsp_buffer;
+    dst = &rbsp->rbsp_buffer[rbsp->rbsp_buffer_size];
 
     memcpy(dst, src, i);
     si = di = i;
diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h
index 20a9d355f2..3a13ba248a 100644
--- a/libavcodec/h2645_parse.h
+++ b/libavcodec/h2645_parse.h
@@ -32,10 +32,8 @@ 
 #define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes
 
 typedef struct H2645NAL {
-    uint8_t *rbsp_buffer;
-
-    int size;
     const uint8_t *data;
+    int size;
 
     /**
      * Size, in bits, of just the data, excluding the stop bit and any trailing