Commit cb8763bd authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '2ea2612d'

* commit '2ea2612d':
  svq1enc: Rename SVQ1Context to SVQ1EncContext

Conflicts:
	libavcodec/svq1enc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b3f46150 2ea2612d
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
typedef struct SVQ1Context { typedef struct SVQ1EncContext {
/* FIXME: Needed for motion estimation, should not be used for anything /* FIXME: Needed for motion estimation, should not be used for anything
* else, the idea is to make the motion estimation eventually independent * else, the idea is to make the motion estimation eventually independent
* of MpegEncContext, so this will be removed then. */ * of MpegEncContext, so this will be removed then. */
...@@ -74,9 +74,9 @@ typedef struct SVQ1Context { ...@@ -74,9 +74,9 @@ typedef struct SVQ1Context {
int64_t rd_total; int64_t rd_total;
uint8_t *scratchbuf; uint8_t *scratchbuf;
} SVQ1Context; } SVQ1EncContext;
static void svq1_write_header(SVQ1Context *s, int frame_type) static void svq1_write_header(SVQ1EncContext *s, int frame_type)
{ {
int i; int i;
...@@ -113,7 +113,7 @@ static void svq1_write_header(SVQ1Context *s, int frame_type) ...@@ -113,7 +113,7 @@ static void svq1_write_header(SVQ1Context *s, int frame_type)
#define QUALITY_THRESHOLD 100 #define QUALITY_THRESHOLD 100
#define THRESHOLD_MULTIPLIER 0.6 #define THRESHOLD_MULTIPLIER 0.6
static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref,
uint8_t *decoded, int stride, int level, uint8_t *decoded, int stride, int level,
int threshold, int lambda, int intra) int threshold, int lambda, int intra)
{ {
...@@ -267,7 +267,7 @@ static void init_block_index(MpegEncContext *s){ ...@@ -267,7 +267,7 @@ static void init_block_index(MpegEncContext *s){
s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x; s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x;
} }
static int svq1_encode_plane(SVQ1Context *s, int plane, static int svq1_encode_plane(SVQ1EncContext *s, int plane,
unsigned char *src_plane, unsigned char *src_plane,
unsigned char *ref_plane, unsigned char *ref_plane,
unsigned char *decoded_plane, unsigned char *decoded_plane,
...@@ -508,7 +508,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, ...@@ -508,7 +508,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
static av_cold int svq1_encode_end(AVCodecContext *avctx) static av_cold int svq1_encode_end(AVCodecContext *avctx)
{ {
SVQ1Context *const s = avctx->priv_data; SVQ1EncContext *const s = avctx->priv_data;
int i; int i;
av_log(avctx, AV_LOG_DEBUG, "RD: %f\n", av_log(avctx, AV_LOG_DEBUG, "RD: %f\n",
...@@ -539,7 +539,7 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx) ...@@ -539,7 +539,7 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
static av_cold int svq1_encode_init(AVCodecContext *avctx) static av_cold int svq1_encode_init(AVCodecContext *avctx)
{ {
SVQ1Context *const s = avctx->priv_data; SVQ1EncContext *const s = avctx->priv_data;
int ret; int ret;
ff_dsputil_init(&s->dsp, avctx); ff_dsputil_init(&s->dsp, avctx);
...@@ -588,8 +588,8 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) ...@@ -588,8 +588,8 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet) const AVFrame *pict, int *got_packet)
{ {
SVQ1Context *const s = avctx->priv_data; SVQ1EncContext *const s = avctx->priv_data;
AVFrame *const p = avctx->coded_frame; AVFrame *const p = avctx->coded_frame;
int i, ret; int i, ret;
if ((ret = ff_alloc_packet2(avctx, pkt, s->y_block_width * s->y_block_height * if ((ret = ff_alloc_packet2(avctx, pkt, s->y_block_width * s->y_block_height *
...@@ -649,7 +649,7 @@ AVCodec ff_svq1_encoder = { ...@@ -649,7 +649,7 @@ AVCodec ff_svq1_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SVQ1, .id = AV_CODEC_ID_SVQ1,
.priv_data_size = sizeof(SVQ1Context), .priv_data_size = sizeof(SVQ1EncContext),
.init = svq1_encode_init, .init = svq1_encode_init,
.encode2 = svq1_encode_frame, .encode2 = svq1_encode_frame,
.close = svq1_encode_end, .close = svq1_encode_end,
......
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