diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-20 17:15:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-20 17:31:55 +0200 |
commit | bb3ed3bae6a9e6e2dbe8deeb45088453f214b770 (patch) | |
tree | 2cb536f24abb5d9cfc275848da43d93d4302d0d2 /libavcodec/utvideodec.c | |
parent | aee51039ee204197fdb4c924f8ee433b803ab1e1 (diff) | |
parent | b96509c93ce6ebb0e997e0b2a55cf10c786a2812 (diff) | |
download | ffmpeg-bb3ed3bae6a9e6e2dbe8deeb45088453f214b770.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
fate: Add FATE tests for the Ut Video encoder
lavc: add Ut Video encoder
mpegvideo_enc: remove stray duplicate line from 7f9aaa4
swscale: x86: fix #endif comments in rgb2rgb template file
avconv: mark more options as expert.
avconv: split printing "main options" into global and per-file.
avconv: refactor help printing.
Conflicts:
Changelog
ffmpeg_opt.c
ffserver.c
libavcodec/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utvideodec.c')
-rw-r--r-- | libavcodec/utvideodec.c | 57 |
1 files changed, 12 insertions, 45 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index ac1c5fed3e..1bd38dca3e 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -32,40 +32,7 @@ #include "get_bits.h" #include "dsputil.h" #include "thread.h" - -enum { - PRED_NONE = 0, - PRED_LEFT, - PRED_GRADIENT, - PRED_MEDIAN, -}; - -typedef struct UtvideoContext { - AVCodecContext *avctx; - AVFrame pic; - DSPContext dsp; - - uint32_t frame_info_size, flags, frame_info; - int planes; - int slices; - int compression; - int interlaced; - int frame_pred; - - uint8_t *slice_bits; - int slice_bits_size; -} UtvideoContext; - -typedef struct HuffEntry { - uint8_t sym; - uint8_t len; -} HuffEntry; - -static int huff_cmp(const void *a, const void *b) -{ - const HuffEntry *aa = a, *bb = b; - return (aa->len - bb->len)*256 + aa->sym - bb->sym; -} +#include "utvideo.h" static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) { @@ -82,7 +49,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) he[i].sym = i; he[i].len = *src++; } - qsort(he, 256, sizeof(*he), huff_cmp); + qsort(he, 256, sizeof(*he), ff_ut_huff_cmp_len); if (!he[0].len) { *fsym = he[0].sym; @@ -216,8 +183,6 @@ fail: return AVERROR_INVALIDDATA; } -static const int rgb_order[4] = { 1, 2, 0, 3 }; - static void restore_rgb_planes(uint8_t *src, int step, int stride, int width, int height) { @@ -432,20 +397,22 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, case PIX_FMT_RGB24: case PIX_FMT_RGBA: for (i = 0; i < c->planes; i++) { - ret = decode_plane(c, i, c->pic.data[0] + rgb_order[i], c->planes, - c->pic.linesize[0], avctx->width, avctx->height, - plane_start[i], c->frame_pred == PRED_LEFT); + ret = decode_plane(c, i, c->pic.data[0] + ff_ut_rgb_order[i], + c->planes, c->pic.linesize[0], avctx->width, + avctx->height, plane_start[i], + c->frame_pred == PRED_LEFT); if (ret) return ret; if (c->frame_pred == PRED_MEDIAN) { if (!c->interlaced) { - restore_median(c->pic.data[0] + rgb_order[i], c->planes, - c->pic.linesize[0], avctx->width, + restore_median(c->pic.data[0] + ff_ut_rgb_order[i], + c->planes, c->pic.linesize[0], avctx->width, avctx->height, c->slices, 0); } else { - restore_median_il(c->pic.data[0] + rgb_order[i], c->planes, - c->pic.linesize[0], avctx->width, - avctx->height, c->slices, 0); + restore_median_il(c->pic.data[0] + ff_ut_rgb_order[i], + c->planes, c->pic.linesize[0], + avctx->width, avctx->height, c->slices, + 0); } } } |