summaryrefslogtreecommitdiff
path: root/libavcodec/utvideoenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-31 12:04:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-31 13:01:30 +0200
commit98298eb1034bddb4557fa689553dae793c2b0092 (patch)
treed35dcd981b6647c9f538bc9b346ab806864bc359 /libavcodec/utvideoenc.c
parentf3683349aecf3be4c9c875186a812c0cde8ecf41 (diff)
parentec36aa69448f20a78d8c4588265022e0b2272ab5 (diff)
Merge commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5'
* commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5': x86: Fix linking with some or all of yasm, mmx, optimizations disabled configure: Add more fine-grained SSE CPU capabilities flags avfilter: x86: Use more precise compile template names x86: cosmetics: Comment some #endifs for better readability g723_1: add comfort noise generation utvideoenc: Switch to dsputils' median prediction utvideoenc: Avoid writing into the input picture avtools: remove the distinction between func_arg and func2_arg. avconv: make the -passlogfile option per-stream. avconv: make the -pass option per-stream. cmdutils: make -codecs print lossy/lossless flags. lavc: add lossy/lossless codec properties. Conflicts: Changelog cmdutils.c configure doc/APIchanges ffmpeg.h ffmpeg_opt.c ffprobe.c libavcodec/codec_desc.c libavcodec/g723_1.c libavcodec/utvideoenc.c libavcodec/version.h libavcodec/x86/mpegaudiodec.c libavcodec/x86/rv40dsp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utvideoenc.c')
-rw-r--r--libavcodec/utvideoenc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index de7be310bc..17e4b29888 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -62,6 +62,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
c->avctx = avctx;
c->frame_info_size = 4;
+ c->slice_stride = FFALIGN(avctx->width, 32);
switch (avctx->pix_fmt) {
case PIX_FMT_RGB24:
@@ -145,7 +146,6 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
}
for (i = 0; i < c->planes; i++) {
- c->slice_stride = FFALIGN(avctx->width, 32);
c->slice_buffer[i] = av_malloc(c->slice_stride * (avctx->height + 2) +
FF_INPUT_BUFFER_PADDING_SIZE);
if (!c->slice_buffer[i]) {
@@ -202,14 +202,14 @@ static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src,
{
int i, j;
int k = 2 * dst_stride;
- unsigned g;
+ unsigned int g;
for (j = 0; j < height; j++) {
if (step == 3) {
for (i = 0; i < width * step; i += step) {
g = src[i + 1];
dst[0][k] = g;
- g += 0x80;
+ g += 0x80;
dst[1][k] = src[i + 2] - g;
dst[2][k] = src[i + 0] - g;
k++;
@@ -218,7 +218,7 @@ static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src,
for (i = 0; i < width * step; i += step) {
g = src[i + 1];
dst[0][k] = g;
- g += 0x80;
+ g += 0x80;
dst[1][k] = src[i + 2] - g;
dst[2][k] = src[i + 0] - g;
dst[3][k] = src[i + 3];
@@ -266,7 +266,7 @@ static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, int st
int width, int height)
{
int i, j;
- int A, C;
+ int A, B;
uint8_t prev;
/* First line uses left neighbour prediction */
@@ -285,11 +285,11 @@ static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, int st
* Second line uses top prediction for the first sample,
* and median for the rest.
*/
- A = C = 0;
+ A = B = 0;
/* Rest of the coded part uses median prediction */
for (j = 1; j < height; j++) {
- c->dsp.sub_hfyu_median_prediction(dst, src - stride, src, width, &A, &C);
+ c->dsp.sub_hfyu_median_prediction(dst, src - stride, src, width, &A, &B);
dst += width;
src += stride;
}