mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
roqvideoenc: add const qualifier to the input frame.
This commit is contained in:
parent
1ea5755046
commit
4fd7cfef0b
@ -69,7 +69,7 @@ typedef struct RoqContext {
|
||||
|
||||
unsigned int framesSinceKeyframe;
|
||||
|
||||
AVFrame *frame_to_enc;
|
||||
const AVFrame *frame_to_enc;
|
||||
uint8_t *out_buf;
|
||||
struct RoqTempData *tmpData;
|
||||
} RoqContext;
|
||||
|
@ -112,7 +112,7 @@ static inline int square(int x)
|
||||
return x*x;
|
||||
}
|
||||
|
||||
static inline int eval_sse(uint8_t *a, uint8_t *b, int count)
|
||||
static inline int eval_sse(const uint8_t *a, const uint8_t *b, int count)
|
||||
{
|
||||
int diff=0;
|
||||
|
||||
@ -124,8 +124,8 @@ static inline int eval_sse(uint8_t *a, uint8_t *b, int count)
|
||||
|
||||
// FIXME Could use DSPContext.sse, but it is not so speed critical (used
|
||||
// just for motion estimation).
|
||||
static int block_sse(uint8_t **buf1, uint8_t **buf2, int x1, int y1, int x2,
|
||||
int y2, int *stride1, int *stride2, int size)
|
||||
static int block_sse(uint8_t * const *buf1, uint8_t * const *buf2, int x1, int y1,
|
||||
int x2, int y2, const int *stride1, const int *stride2, int size)
|
||||
{
|
||||
int i, k;
|
||||
int sse=0;
|
||||
@ -260,7 +260,7 @@ static void create_cel_evals(RoqContext *enc, RoqTempdata *tempData)
|
||||
/**
|
||||
* Get macroblocks from parts of the image
|
||||
*/
|
||||
static void get_frame_mb(AVFrame *frame, int x, int y, uint8_t mb[], int dim)
|
||||
static void get_frame_mb(const AVFrame *frame, int x, int y, uint8_t mb[], int dim)
|
||||
{
|
||||
int i, j, cp;
|
||||
|
||||
@ -754,8 +754,8 @@ static void reconstruct_and_encode_image(RoqContext *enc, RoqTempdata *tempData,
|
||||
/**
|
||||
* Create a single YUV cell from a 2x2 section of the image
|
||||
*/
|
||||
static inline void frame_block_to_cell(uint8_t *block, uint8_t **data,
|
||||
int top, int left, int *stride)
|
||||
static inline void frame_block_to_cell(uint8_t *block, uint8_t * const *data,
|
||||
int top, int left, const int *stride)
|
||||
{
|
||||
int i, j, u=0, v=0;
|
||||
|
||||
@ -775,7 +775,7 @@ static inline void frame_block_to_cell(uint8_t *block, uint8_t **data,
|
||||
/**
|
||||
* Create YUV clusters for the entire image
|
||||
*/
|
||||
static void create_clusters(AVFrame *frame, int w, int h, uint8_t *yuvClusters)
|
||||
static void create_clusters(const AVFrame *frame, int w, int h, uint8_t *yuvClusters)
|
||||
{
|
||||
int i, j, k, l;
|
||||
|
||||
@ -1004,7 +1004,7 @@ static void roq_write_video_info_chunk(RoqContext *enc)
|
||||
static int roq_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
|
||||
{
|
||||
RoqContext *enc = avctx->priv_data;
|
||||
AVFrame *frame= data;
|
||||
const AVFrame *frame= data;
|
||||
uint8_t *buf_start = buf;
|
||||
|
||||
enc->out_buf = buf;
|
||||
|
Loading…
Reference in New Issue
Block a user