avutil/imgutils: Constify some pointees

This is done immediately without waiting for the next major bump
just as in 9546b3a1cb and
4eaaa38d3d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/390/head
Andreas Rheinhardt 1 year ago
parent 8cd2e0c075
commit 41285890e0
  1. 4
      doc/APIchanges
  2. 14
      libavutil/imgutils.c
  3. 10
      libavutil/imgutils.h
  4. 2
      libavutil/version.h

@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
2023-09-07 - xxxxxxxxxx - lavu 58.20.100 - imgutils.h
Constify some pointees in av_image_copy(), av_image_copy_uc_from() and
av_image_fill_black().
2023-09-07 - xxxxxxxxxx - lavf 60.12.100 - avio.h
Constify the buffer pointees in the write_packet and write_data_type
callbacks of AVIOContext on the next major bump.

@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize,
image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height);
}
static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height,
void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *,
ptrdiff_t, ptrdiff_t, int))
@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
}
}
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
const uint8_t *src_data[4], const int src_linesizes[4],
void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4],
const uint8_t * const src_data[4], const int src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height)
{
ptrdiff_t dst_linesizes1[4], src_linesizes1[4];
@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
width, height, image_copy_plane);
}
void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height)
{
image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt,
@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear,
// if it's a subsampled packed format).
#define MAX_BLOCK_SIZE 32
int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4],
enum AVPixelFormat pix_fmt, enum AVColorRange range,
int width, int height)
{

@ -170,8 +170,8 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize,
* @param width width of the image in pixels
* @param height height of the image in pixels
*/
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
const uint8_t *src_data[4], const int src_linesizes[4],
void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4],
const uint8_t * const src_data[4], const int src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height);
/**
@ -188,8 +188,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
* @note On x86, the linesizes currently need to be aligned to the cacheline
* size (i.e. 64) to get improved performance.
*/
void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height);
/**
@ -319,7 +319,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar);
* @param height the height of the image in pixels
* @return 0 if the image data was cleared, a negative AVERROR code otherwise
*/
int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4],
enum AVPixelFormat pix_fmt, enum AVColorRange range,
int width, int height);

@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 58
#define LIBAVUTIL_VERSION_MINOR 19
#define LIBAVUTIL_VERSION_MINOR 20
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Loading…
Cancel
Save