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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user