Commit 4fd7cfef authored by Anton Khirnov's avatar Anton Khirnov

roqvideoenc: add const qualifier to the input frame.

parent 1ea57550
...@@ -69,7 +69,7 @@ typedef struct RoqContext { ...@@ -69,7 +69,7 @@ typedef struct RoqContext {
unsigned int framesSinceKeyframe; unsigned int framesSinceKeyframe;
AVFrame *frame_to_enc; const AVFrame *frame_to_enc;
uint8_t *out_buf; uint8_t *out_buf;
struct RoqTempData *tmpData; struct RoqTempData *tmpData;
} RoqContext; } RoqContext;
......
...@@ -112,7 +112,7 @@ static inline int square(int x) ...@@ -112,7 +112,7 @@ static inline int square(int x)
return x*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; int diff=0;
...@@ -124,8 +124,8 @@ static inline int eval_sse(uint8_t *a, uint8_t *b, int count) ...@@ -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 // FIXME Could use DSPContext.sse, but it is not so speed critical (used
// just for motion estimation). // just for motion estimation).
static int block_sse(uint8_t **buf1, uint8_t **buf2, int x1, int y1, int x2, static int block_sse(uint8_t * const *buf1, uint8_t * const *buf2, int x1, int y1,
int y2, int *stride1, int *stride2, int size) int x2, int y2, const int *stride1, const int *stride2, int size)
{ {
int i, k; int i, k;
int sse=0; int sse=0;
...@@ -260,7 +260,7 @@ static void create_cel_evals(RoqContext *enc, RoqTempdata *tempData) ...@@ -260,7 +260,7 @@ static void create_cel_evals(RoqContext *enc, RoqTempdata *tempData)
/** /**
* Get macroblocks from parts of the image * 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; int i, j, cp;
...@@ -754,8 +754,8 @@ static void reconstruct_and_encode_image(RoqContext *enc, RoqTempdata *tempData, ...@@ -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 * 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, static inline void frame_block_to_cell(uint8_t *block, uint8_t * const *data,
int top, int left, int *stride) int top, int left, const int *stride)
{ {
int i, j, u=0, v=0; int i, j, u=0, v=0;
...@@ -775,7 +775,7 @@ static inline void frame_block_to_cell(uint8_t *block, uint8_t **data, ...@@ -775,7 +775,7 @@ static inline void frame_block_to_cell(uint8_t *block, uint8_t **data,
/** /**
* Create YUV clusters for the entire image * 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; int i, j, k, l;
...@@ -1004,7 +1004,7 @@ static void roq_write_video_info_chunk(RoqContext *enc) ...@@ -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) static int roq_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
{ {
RoqContext *enc = avctx->priv_data; RoqContext *enc = avctx->priv_data;
AVFrame *frame= data; const AVFrame *frame= data;
uint8_t *buf_start = buf; uint8_t *buf_start = buf;
enc->out_buf = buf; enc->out_buf = buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment