Skip to content

Commit

Permalink
avcodec/ffv1, ffv1dec: Add const where appropriate
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Dec 19, 2021
1 parent 17605d1 commit 485121b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libavcodec/ffv1.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
return 0;
}

av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
av_cold int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs)
{
int j, i;

Expand Down Expand Up @@ -170,7 +170,7 @@ int ff_ffv1_allocate_initial_states(FFV1Context *f)
return 0;
}

void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1Context *fs)
{
int i, j;

Expand Down
4 changes: 2 additions & 2 deletions libavcodec/ffv1.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ typedef struct FFV1Context {
} FFV1Context;

int ff_ffv1_common_init(AVCodecContext *avctx);
int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs);
int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1Context *fs);
int ff_ffv1_init_slices_state(FFV1Context *f);
int ff_ffv1_init_slice_contexts(FFV1Context *f);
int ff_ffv1_allocate_initial_states(FFV1Context *f);
void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs);
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1Context *fs);
int ff_ffv1_close(AVCodecContext *avctx);

static av_always_inline int fold(int diff, int bits)
Expand Down
5 changes: 3 additions & 2 deletions libavcodec/ffv1dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int decode_plane(FFV1Context *s, uint8_t *src,
return 0;
}

static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
static int decode_slice_header(const FFV1Context *f, FFV1Context *fs)
{
RangeCoder *c = &fs->c;
uint8_t state[CONTEXT_SIZE];
Expand Down Expand Up @@ -974,7 +974,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
return buf_size;
}

static void copy_fields(FFV1Context *fsdst, FFV1Context *fssrc, FFV1Context *fsrc)
static void copy_fields(FFV1Context *fsdst, const FFV1Context *fssrc,
const FFV1Context *fsrc)
{
fsdst->version = fsrc->version;
fsdst->micro_version = fsrc->micro_version;
Expand Down

0 comments on commit 485121b

Please sign in to comment.