* commit '238614de679a71970c20d7c3fee08a322967ec40': cdgraphics: do not rely on get_buffer() initializing the frame. svq1: replace struct svq1_frame_size with an array. vf_yadif: silence a warning. Conflicts: libavcodec/svq1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n1.2
@@ -1856,7 +1856,7 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu | |||||
/* XXX this shouldn't be needed, but some tests break without this line | /* XXX this shouldn't be needed, but some tests break without this line | ||||
* those decoders are buggy and need to be fixed. | * those decoders are buggy and need to be fixed. | ||||
* the following tests fail: | * the following tests fail: | ||||
* cdgraphics, ansi, aasc, fraps-v1, qtrle-1bit | |||||
* ansi, aasc, fraps-v1, qtrle-1bit | |||||
*/ | */ | ||||
memset(buf->base[0], 128, ret); | memset(buf->base[0], 128, ret); | ||||
@@ -291,6 +291,8 @@ static int cdg_decode_frame(AVCodecContext *avctx, | |||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); | av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); | ||||
return ret; | return ret; | ||||
} | } | ||||
if (!avctx->frame_number) | |||||
memset(cc->frame.data[0], 0, cc->frame.linesize[0] * avctx->height); | |||||
command = bytestream_get_byte(&buf); | command = bytestream_get_byte(&buf); | ||||
inst = bytestream_get_byte(&buf); | inst = bytestream_get_byte(&buf); | ||||
@@ -37,7 +37,7 @@ | |||||
#include "svq1_vlc.h" | #include "svq1_vlc.h" | ||||
/* standard video sizes */ | /* standard video sizes */ | ||||
const struct svq1_frame_size ff_svq1_frame_size_table[7] = { | |||||
const uint16_t ff_svq1_frame_size_table[7][2] = { | |||||
{ 160, 120 }, { 128, 96 }, { 176, 144 }, { 352, 288 }, | { 160, 120 }, { 128, 96 }, { 176, 144 }, { 352, 288 }, | ||||
{ 704, 576 }, { 240, 180 }, { 320, 240 } | { 704, 576 }, { 240, 180 }, { 320, 240 } | ||||
}; | }; |
@@ -42,11 +42,6 @@ | |||||
#define SVQ1_BLOCK_INTER_4V 2 | #define SVQ1_BLOCK_INTER_4V 2 | ||||
#define SVQ1_BLOCK_INTRA 3 | #define SVQ1_BLOCK_INTRA 3 | ||||
struct svq1_frame_size { | |||||
uint16_t width; | |||||
uint16_t height; | |||||
}; | |||||
uint16_t ff_svq1_packet_checksum(const uint8_t *data, | uint16_t ff_svq1_packet_checksum(const uint8_t *data, | ||||
const int length, int value); | const int length, int value); | ||||
@@ -59,6 +54,6 @@ extern const uint8_t ff_svq1_inter_multistage_vlc[6][8][2]; | |||||
extern const uint16_t ff_svq1_intra_mean_vlc[256][2]; | extern const uint16_t ff_svq1_intra_mean_vlc[256][2]; | ||||
extern const uint16_t ff_svq1_inter_mean_vlc[512][2]; | extern const uint16_t ff_svq1_inter_mean_vlc[512][2]; | ||||
extern const struct svq1_frame_size ff_svq1_frame_size_table[7]; | |||||
extern const uint16_t ff_svq1_frame_size_table[7][2]; | |||||
#endif /* AVCODEC_SVQ1_H */ | #endif /* AVCODEC_SVQ1_H */ |
@@ -575,8 +575,8 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) | |||||
return AVERROR_INVALIDDATA; | return AVERROR_INVALIDDATA; | ||||
} else { | } else { | ||||
/* get width, height from table */ | /* get width, height from table */ | ||||
width = ff_svq1_frame_size_table[frame_size_code].width; | |||||
height = ff_svq1_frame_size_table[frame_size_code].height; | |||||
width = ff_svq1_frame_size_table[frame_size_code][0]; | |||||
height = ff_svq1_frame_size_table[frame_size_code][1]; | |||||
} | } | ||||
} | } | ||||
@@ -81,10 +81,14 @@ | |||||
next2++; \ | next2++; \ | ||||
} | } | ||||
static void filter_line_c(uint8_t *dst, | |||||
uint8_t *prev, uint8_t *cur, uint8_t *next, | |||||
static void filter_line_c(void *dst1, | |||||
void *prev1, void *cur1, void *next1, | |||||
int w, int prefs, int mrefs, int parity, int mode) | int w, int prefs, int mrefs, int parity, int mode) | ||||
{ | { | ||||
uint8_t *dst = dst1; | |||||
uint8_t *prev = prev1; | |||||
uint8_t *cur = cur1; | |||||
uint8_t *next = next1; | |||||
int x; | int x; | ||||
uint8_t *prev2 = parity ? prev : cur ; | uint8_t *prev2 = parity ? prev : cur ; | ||||
uint8_t *next2 = parity ? cur : next; | uint8_t *next2 = parity ? cur : next; | ||||
@@ -92,11 +96,15 @@ static void filter_line_c(uint8_t *dst, | |||||
FILTER | FILTER | ||||
} | } | ||||
static void filter_line_c_16bit(uint16_t *dst, | |||||
uint16_t *prev, uint16_t *cur, uint16_t *next, | |||||
static void filter_line_c_16bit(void *dst1, | |||||
void *prev1, void *cur1, void *next1, | |||||
int w, int prefs, int mrefs, int parity, | int w, int prefs, int mrefs, int parity, | ||||
int mode) | int mode) | ||||
{ | { | ||||
uint16_t *dst = dst1; | |||||
uint16_t *prev = prev1; | |||||
uint16_t *cur = cur1; | |||||
uint16_t *next = next1; | |||||
int x; | int x; | ||||
uint16_t *prev2 = parity ? prev : cur ; | uint16_t *prev2 = parity ? prev : cur ; | ||||
uint16_t *next2 = parity ? cur : next; | uint16_t *next2 = parity ? cur : next; | ||||
@@ -26,14 +26,14 @@ | |||||
#include "libavcodec/x86/dsputil_mmx.h" | #include "libavcodec/x86/dsputil_mmx.h" | ||||
#include "libavfilter/yadif.h" | #include "libavfilter/yadif.h" | ||||
void ff_yadif_filter_line_mmxext(uint8_t *dst, uint8_t *prev, uint8_t *cur, | |||||
uint8_t *next, int w, int prefs, | |||||
void ff_yadif_filter_line_mmxext(void *dst, void *prev, void *cur, | |||||
void *next, int w, int prefs, | |||||
int mrefs, int parity, int mode); | int mrefs, int parity, int mode); | ||||
void ff_yadif_filter_line_sse2(uint8_t *dst, uint8_t *prev, uint8_t *cur, | |||||
uint8_t *next, int w, int prefs, | |||||
void ff_yadif_filter_line_sse2(void *dst, void *prev, void *cur, | |||||
void *next, int w, int prefs, | |||||
int mrefs, int parity, int mode); | int mrefs, int parity, int mode); | ||||
void ff_yadif_filter_line_ssse3(uint8_t *dst, uint8_t *prev, uint8_t *cur, | |||||
uint8_t *next, int w, int prefs, | |||||
void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur, | |||||
void *next, int w, int prefs, | |||||
int mrefs, int parity, int mode); | int mrefs, int parity, int mode); | ||||
av_cold void ff_yadif_init_x86(YADIFContext *yadif) | av_cold void ff_yadif_init_x86(YADIFContext *yadif) | ||||
@@ -53,8 +53,8 @@ typedef struct YADIFContext { | |||||
AVFilterBufferRef *next; | AVFilterBufferRef *next; | ||||
AVFilterBufferRef *prev; | AVFilterBufferRef *prev; | ||||
AVFilterBufferRef *out; | AVFilterBufferRef *out; | ||||
void (*filter_line)(uint8_t *dst, | |||||
uint8_t *prev, uint8_t *cur, uint8_t *next, | |||||
void (*filter_line)(void *dst, | |||||
void *prev, void *cur, void *next, | |||||
int w, int prefs, int mrefs, int parity, int mode); | int w, int prefs, int mrefs, int parity, int mode); | ||||
const AVPixFmtDescriptor *csp; | const AVPixFmtDescriptor *csp; | ||||
@@ -1,20 +1,20 @@ | |||||
#tb 0: 1/300 | #tb 0: 1/300 | ||||
0, 0, 0, 1, 194400, 0xd919c635 | |||||
0, 1, 1, 1, 194400, 0xd919c635 | |||||
0, 2, 2, 1, 194400, 0x516a1007 | |||||
0, 3, 3, 1, 194400, 0x516a1007 | |||||
0, 4, 4, 1, 194400, 0x516a1007 | |||||
0, 5, 5, 1, 194400, 0x516a1007 | |||||
0, 6, 6, 1, 194400, 0x516a1007 | |||||
0, 7, 7, 1, 194400, 0x516a1007 | |||||
0, 8, 8, 1, 194400, 0x516a1007 | |||||
0, 9, 9, 1, 194400, 0x516a1007 | |||||
0, 10, 10, 1, 194400, 0x516a1007 | |||||
0, 11, 11, 1, 194400, 0x516a1007 | |||||
0, 12, 12, 1, 194400, 0x516a1007 | |||||
0, 13, 13, 1, 194400, 0x516a1007 | |||||
0, 14, 14, 1, 194400, 0x516a1007 | |||||
0, 15, 15, 1, 194400, 0x516a1007 | |||||
0, 0, 0, 1, 194400, 0x46ad80da | |||||
0, 1, 1, 1, 194400, 0x46ad80da | |||||
0, 2, 2, 1, 194400, 0x9392c3b9 | |||||
0, 3, 3, 1, 194400, 0x9392c3b9 | |||||
0, 4, 4, 1, 194400, 0x9392c3b9 | |||||
0, 5, 5, 1, 194400, 0x9392c3b9 | |||||
0, 6, 6, 1, 194400, 0x9392c3b9 | |||||
0, 7, 7, 1, 194400, 0x9392c3b9 | |||||
0, 8, 8, 1, 194400, 0x9392c3b9 | |||||
0, 9, 9, 1, 194400, 0x9392c3b9 | |||||
0, 10, 10, 1, 194400, 0x9392c3b9 | |||||
0, 11, 11, 1, 194400, 0x9392c3b9 | |||||
0, 12, 12, 1, 194400, 0x9392c3b9 | |||||
0, 13, 13, 1, 194400, 0x9392c3b9 | |||||
0, 14, 14, 1, 194400, 0x9392c3b9 | |||||
0, 15, 15, 1, 194400, 0x9392c3b9 | |||||
0, 16, 16, 1, 194400, 0x46ad80da | 0, 16, 16, 1, 194400, 0x46ad80da | ||||
0, 17, 17, 1, 194400, 0x46ad80da | 0, 17, 17, 1, 194400, 0x46ad80da | ||||
0, 18, 18, 1, 194400, 0x46ad80da | 0, 18, 18, 1, 194400, 0x46ad80da | ||||