aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-13 04:40:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-13 04:40:40 +0200
commit72153419b52c96b1ed4a1bfb7e7793ddde7d71b2 (patch)
tree2e5b40aecf44ad40dd0d6bf122fd8918a889805e /libavcodec/ffv1.c
parent410ca3bc2d5e95078f3d6698a2f9e53c2fd24f95 (diff)
parent552a99957f7c6f6ed13795caee7ab7b9deb5d76e (diff)
downloadffmpeg-72153419b52c96b1ed4a1bfb7e7793ddde7d71b2.tar.gz
Merge remote branch 'qatar/master'
* qatar/master: (33 commits) rtpdec_qdm2: Don't try to parse data packet if no configuration is received ac3enc: put the counting of stereo rematrixing bits in the same place to make the code easier to understand. ac3enc: clean up count_frame_bits() and count_frame_bits_fixed() mpegvideo: make FF_DEBUG_DCT_COEFF output coeffs via av_log() instead of just via AVFrame. srtdec: make sure we don't write past the end of buffer wmaenc: improve channel count and bitrate error handling in encode_init() matroskaenc: make sure we don't produce invalid file with no codec ID matroskadec: check that pointers were initialized before accessing them lavf: fix function name in compute_pkt_fields2 av_dlog message lavf: fix av_find_best_stream when providing a wanted stream. lavf: fix av_find_best_stream when decoder_ret is given and using a related stream. ffmpeg: factorize quality calculation tiff: add support for SamplesPerPixel tag in tiff_decode_tag() tiff: Prefer enum TiffCompr over int for TiffContext.compr. mov: Support edit list atom version 1. configure: Enable libpostproc automatically if GPL code is enabled. Cosmetics: fix prototypes in oggdec oggdec: fix memleak with continuous streams. matroskaenc: add missing new line in av_log() call dnxhdenc: add AVClass in private context. ... swscale changes largely rewritten by me or replaced by baptsites due to lots of bugs in ronalds code. Above code is also just in case its not obvios to a large extended duplicates that where cherry picked from ffmpeg. Conflicts: configure ffmpeg.c libavformat/matroskaenc.c libavutil/pixfmt.h libswscale/ppc/swscale_template.c libswscale/swscale.c libswscale/swscale_template.c libswscale/utils.c libswscale/x86/swscale_template.c tests/fate/h264.mak tests/ref/lavfi/pixdesc_le tests/ref/lavfi/pixfmts_copy_le tests/ref/lavfi/pixfmts_null_le tests/ref/lavfi/pixfmts_scale_le tests/ref/lavfi/pixfmts_vflip_le Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 8c1e3d301f..4e0e5f7b62 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -250,7 +250,7 @@ typedef struct FFV1Context{
uint8_t (*initial_states[MAX_QUANT_TABLES])[32];
int run_index;
int colorspace;
- int_fast16_t *sample_buffer;
+ int16_t *sample_buffer;
int gob_count;
int packed_at_lsb;
@@ -280,7 +280,8 @@ static av_always_inline int fold(int diff, int bits){
return diff;
}
-static inline int predict(int_fast16_t *src, int_fast16_t *last){
+static inline int predict(int16_t *src, int16_t *last)
+{
const int LT= last[-1];
const int T= last[ 0];
const int L = src[-1];
@@ -288,7 +289,9 @@ static inline int predict(int_fast16_t *src, int_fast16_t *last){
return mid_pred(L, L + T - LT, T);
}
-static inline int get_context(PlaneContext *p, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
+static inline int get_context(PlaneContext *p, int16_t *src,
+ int16_t *last, int16_t *last2)
+{
const int LT= last[-1];
const int T= last[ 0];
const int RT= last[ 1];
@@ -507,7 +510,10 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int
}
#if CONFIG_FFV1_ENCODER
-static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
+static av_always_inline int encode_line(FFV1Context *s, int w,
+ int16_t *sample[2],
+ int plane_index, int bits)
+{
PlaneContext * const p= &s->plane[plane_index];
RangeCoder * const c= &s->c;
int x;
@@ -592,7 +598,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sam
static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
int x,y,i;
const int ring_size= s->avctx->context_model ? 3 : 2;
- int_fast16_t *sample[3];
+ int16_t *sample[3];
s->run_index=0;
memset(s->sample_buffer, 0, ring_size*(w+6)*sizeof(*s->sample_buffer));
@@ -628,7 +634,7 @@ static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
static void encode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
int x, y, p, i;
const int ring_size= s->avctx->context_model ? 3 : 2;
- int_fast16_t *sample[3][3];
+ int16_t *sample[3][3];
s->run_index=0;
memset(s->sample_buffer, 0, ring_size*3*(w+6)*sizeof(*s->sample_buffer));
@@ -1318,7 +1324,10 @@ static av_cold int common_end(AVCodecContext *avctx){
return 0;
}
-static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
+static av_always_inline void decode_line(FFV1Context *s, int w,
+ int16_t *sample[2],
+ int plane_index, int bits)
+{
PlaneContext * const p= &s->plane[plane_index];
RangeCoder * const c= &s->c;
int x;
@@ -1378,7 +1387,7 @@ static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sa
static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
int x, y;
- int_fast16_t *sample[2];
+ int16_t *sample[2];
sample[0]=s->sample_buffer +3;
sample[1]=s->sample_buffer+w+6+3;
@@ -1387,7 +1396,7 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
memset(s->sample_buffer, 0, 2*(w+6)*sizeof(*s->sample_buffer));
for(y=0; y<h; y++){
- int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
+ int16_t *temp = sample[0]; //FIXME try a normal buffer
sample[0]= sample[1];
sample[1]= temp;
@@ -1419,7 +1428,7 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
int x, y, p;
- int_fast16_t *sample[3][2];
+ int16_t *sample[3][2];
for(x=0; x<3; x++){
sample[x][0] = s->sample_buffer + x*2 *(w+6) + 3;
sample[x][1] = s->sample_buffer + (x*2+1)*(w+6) + 3;
@@ -1431,7 +1440,7 @@ static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int st
for(y=0; y<h; y++){
for(p=0; p<3; p++){
- int_fast16_t *temp= sample[p][0]; //FIXME try a normal buffer
+ int16_t *temp = sample[p][0]; //FIXME try a normal buffer
sample[p][0]= sample[p][1];
sample[p][1]= temp;