extern const uint8_t ff_cavs_chroma_qp[64];
extern const uint8_t ff_cavs_scan3x3[4];
extern const uint8_t ff_cavs_partition_flags[30];
-extern const int_fast8_t ff_left_modifier_l[8];
-extern const int_fast8_t ff_top_modifier_l[8];
-extern const int_fast8_t ff_left_modifier_c[7];
-extern const int_fast8_t ff_top_modifier_c[7];
+extern const int8_t ff_left_modifier_l[8];
+extern const int8_t ff_top_modifier_l[8];
+extern const int8_t ff_left_modifier_c[7];
+extern const int8_t ff_top_modifier_c[7];
extern const cavs_vector ff_cavs_intra_mv;
extern const cavs_vector ff_cavs_un_mv;
extern const cavs_vector ff_cavs_dir_mv;
-static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
+static inline void modify_pred(const int8_t *mod_table, int *mode)
+{
*mode = mod_table[*mode];
if(*mode < 0) {
av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n");
5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
};
-const int_fast8_t ff_left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
-const int_fast8_t ff_top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7};
-const int_fast8_t ff_left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
-const int_fast8_t ff_top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6};
+const int8_t ff_left_modifier_l[8] = { 0, -1, 6, -1, -1, 7, 6, 7 };
+const int8_t ff_top_modifier_l[8] = { -1, 1, 5, -1, -1, 5, 7, 7 };
+const int8_t ff_left_modifier_c[7] = { 5, -1, 2, -1, 6, 5, 6 };
+const int8_t ff_top_modifier_c[7] = { 4, 1, -1, -1, 4, 6, 6 };
#endif /* AVCODEC_CAVSDATA_H */
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 quant_table_count;
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];
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];
}
#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;
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));
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));
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;
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;
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;
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;
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;
// reasonable to check redundantly.
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
{
- uint_fast32_t exit_at_level[33] = {
- 404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ uint32_t exit_at_level[33] = { 404 };
unsigned i, j, p, code;
#ifdef V_DEBUG
av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
- init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
+ init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
for (i = 0; i < bits[p]; ++i)
av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
av_log(NULL, AV_LOG_INFO, "\n");
}
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- uint_fast16_t *y_list, int *flag,
+ uint16_t *y_list, int *flag,
int multiplier, float *out, int samples)
{
int lx, ly, i;
extern const int64_t ff_vorbis_channel_layouts[9];
typedef struct {
- uint_fast16_t x;
- uint_fast16_t sort;
- uint_fast16_t low;
- uint_fast16_t high;
+ uint16_t x;
+ uint16_t sort;
+ uint16_t low;
+ uint16_t high;
} vorbis_floor1_entry;
void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values);
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- uint_fast16_t * y_list, int * flag,
+ uint16_t *y_list, int *flag,
int multiplier, float * out, int samples);
void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
#include <assert.h>
typedef struct {
- uint_fast8_t dimensions;
- uint_fast8_t lookup_type;
- uint_fast8_t maxdepth;
- VLC vlc;
- float *codevectors;
+ uint8_t dimensions;
+ uint8_t lookup_type;
+ uint8_t maxdepth;
+ VLC vlc;
+ float *codevectors;
unsigned int nb_bits;
} vorbis_codebook;
int (* vorbis_floor_decode_func)
(struct vorbis_context_s *, vorbis_floor_data *, float *);
typedef struct {
- uint_fast8_t floor_type;
+ uint8_t floor_type;
vorbis_floor_decode_func decode;
union vorbis_floor_u {
struct vorbis_floor0_s {
- uint_fast8_t order;
- uint_fast16_t rate;
- uint_fast16_t bark_map_size;
- int_fast32_t *map[2];
- uint_fast32_t map_size[2];
- uint_fast8_t amplitude_bits;
- uint_fast8_t amplitude_offset;
- uint_fast8_t num_books;
- uint_fast8_t *book_list;
+ uint8_t order;
+ uint16_t rate;
+ uint16_t bark_map_size;
+ int32_t *map[2];
+ uint32_t map_size[2];
+ uint8_t amplitude_bits;
+ uint8_t amplitude_offset;
+ uint8_t num_books;
+ uint8_t *book_list;
float *lsp;
} t0;
struct vorbis_floor1_s {
- uint_fast8_t partitions;
- uint8_t partition_class[32];
- uint_fast8_t class_dimensions[16];
- uint_fast8_t class_subclasses[16];
- uint_fast8_t class_masterbook[16];
- int_fast16_t subclass_books[16][8];
- uint_fast8_t multiplier;
- uint_fast16_t x_list_dim;
+ uint8_t partitions;
+ uint8_t partition_class[32];
+ uint8_t class_dimensions[16];
+ uint8_t class_subclasses[16];
+ uint8_t class_masterbook[16];
+ int16_t subclass_books[16][8];
+ uint8_t multiplier;
+ uint16_t x_list_dim;
vorbis_floor1_entry *list;
} t1;
} data;
} vorbis_floor;
typedef struct {
- uint_fast16_t type;
- uint_fast32_t begin;
- uint_fast32_t end;
+ uint16_t type;
+ uint32_t begin;
+ uint32_t end;
unsigned partition_size;
- uint_fast8_t classifications;
- uint_fast8_t classbook;
- int_fast16_t books[64][8];
- uint_fast8_t maxpass;
- uint_fast16_t ptns_to_read;
- uint8_t *classifs;
+ uint8_t classifications;
+ uint8_t classbook;
+ int16_t books[64][8];
+ uint8_t maxpass;
+ uint16_t ptns_to_read;
+ uint8_t *classifs;
} vorbis_residue;
typedef struct {
- uint_fast8_t submaps;
- uint_fast16_t coupling_steps;
- uint_fast8_t *magnitude;
- uint_fast8_t *angle;
- uint_fast8_t *mux;
- uint_fast8_t submap_floor[16];
- uint_fast8_t submap_residue[16];
+ uint8_t submaps;
+ uint16_t coupling_steps;
+ uint8_t *magnitude;
+ uint8_t *angle;
+ uint8_t *mux;
+ uint8_t submap_floor[16];
+ uint8_t submap_residue[16];
} vorbis_mapping;
typedef struct {
- uint_fast8_t blockflag;
- uint_fast16_t windowtype;
- uint_fast16_t transformtype;
- uint_fast8_t mapping;
+ uint8_t blockflag;
+ uint16_t windowtype;
+ uint16_t transformtype;
+ uint8_t mapping;
} vorbis_mode;
typedef struct vorbis_context_s {
FmtConvertContext fmt_conv;
FFTContext mdct[2];
- uint_fast8_t first_frame;
- uint_fast32_t version;
- uint_fast8_t audio_channels;
- uint_fast32_t audio_samplerate;
- uint_fast32_t bitrate_maximum;
- uint_fast32_t bitrate_nominal;
- uint_fast32_t bitrate_minimum;
- uint_fast32_t blocksize[2];
+ uint8_t first_frame;
+ uint32_t version;
+ uint8_t audio_channels;
+ uint32_t audio_samplerate;
+ uint32_t bitrate_maximum;
+ uint32_t bitrate_nominal;
+ uint32_t bitrate_minimum;
+ uint32_t blocksize[2];
const float *win[2];
- uint_fast16_t codebook_count;
+ uint16_t codebook_count;
vorbis_codebook *codebooks;
- uint_fast8_t floor_count;
+ uint8_t floor_count;
vorbis_floor *floors;
- uint_fast8_t residue_count;
+ uint8_t residue_count;
vorbis_residue *residues;
- uint_fast8_t mapping_count;
+ uint8_t mapping_count;
vorbis_mapping *mappings;
- uint_fast8_t mode_count;
+ uint8_t mode_count;
vorbis_mode *modes;
- uint_fast8_t mode_number; // mode number for the current packet
- uint_fast8_t previous_window;
+ uint8_t mode_number; // mode number for the current packet
+ uint8_t previous_window;
float *channel_residues;
float *channel_floors;
float *saved;
uint8_t *tmp_vlc_bits;
uint32_t *tmp_vlc_codes;
GetBitContext *gb = &vc->gb;
- uint_fast16_t *codebook_multiplicands;
+ uint16_t *codebook_multiplicands;
vc->codebook_count = get_bits(gb, 8) + 1;
codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);
AV_DEBUG(" multiplicands*delta+minmum : %e \n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);
- AV_DEBUG(" multiplicand %d \n", codebook_multiplicands[i]);
+ AV_DEBUG(" multiplicand %u\n", codebook_multiplicands[i]);
}
// Weed out unused vlcs and build codevector vector
rangemax = (1 << rangebits);
if (rangemax > vc->blocksize[1] / 2) {
av_log(vc->avccontext, AV_LOG_ERROR,
- "Floor value is too large for blocksize: %u (%"PRIuFAST32")\n",
+ "Floor value is too large for blocksize: %u (%"PRIu32")\n",
rangemax, vc->blocksize[1] / 2);
return -1;
}
for (i = 0; i < vc->residue_count; ++i) {
vorbis_residue *res_setup = &vc->residues[i];
- uint_fast8_t cascade[64];
+ uint8_t cascade[64];
unsigned high_bits, low_bits;
res_setup->type = get_bits(gb, 16);
if (res_setup->begin>res_setup->end ||
res_setup->end > vc->avccontext->channels * vc->blocksize[1] / 2 ||
(res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
- av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %u, %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2);
+ av_log(vc->avccontext, AV_LOG_ERROR,
+ "partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
+ res_setup->type, res_setup->begin, res_setup->end,
+ res_setup->partition_size, vc->blocksize[1] / 2);
return -1;
}
vorbis_floor0 *vf;
int idx;
int blockflag, n;
- int_fast32_t *map;
+ int32_t *map;
for (blockflag = 0; blockflag < 2; ++blockflag) {
n = vc->blocksize[blockflag] / 2;
floors[floor_number].data.t0.map[blockflag] =
- av_malloc((n+1) * sizeof(int_fast32_t)); // n + sentinel
+ av_malloc((n + 1) * sizeof(int32_t)); // n + sentinel
map = floors[floor_number].data.t0.map[blockflag];
vf = &floors[floor_number].data.t0;
{
vorbis_floor1 *vf = &vfu->t1;
GetBitContext *gb = &vc->gb;
- uint_fast16_t range_v[4] = { 256, 128, 86, 64 };
- unsigned range = range_v[vf->multiplier-1];
- uint_fast16_t floor1_Y[258];
- uint_fast16_t floor1_Y_final[258];
+ uint16_t range_v[4] = { 256, 128, 86, 64 };
+ unsigned range = range_v[vf->multiplier - 1];
+ uint16_t floor1_Y[258];
+ uint16_t floor1_Y_final[258];
int floor1_flag[258];
unsigned class, cdim, cbits, csub, cval, offset, i, j;
int book, adx, ady, dy, off, predicted, err;
floor1_Y_final[i] = predicted;
}
- AV_DEBUG(" Decoded floor(%d) = %d / val %u\n",
+ AV_DEBUG(" Decoded floor(%d) = %u / val %u\n",
vf->list[i].x, floor1_Y_final[i], val);
}
static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
vorbis_residue *vr,
unsigned ch,
- uint_fast8_t *do_not_decode,
+ uint8_t *do_not_decode,
float *vec,
unsigned vlen,
int vr_type)
static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
unsigned ch,
- uint_fast8_t *do_not_decode,
+ uint8_t *do_not_decode,
float *vec, unsigned vlen)
{
if (vr->type == 2)
unsigned previous_window = vc->previous_window;
unsigned mode_number, blockflag, blocksize;
int i, j;
- uint_fast8_t no_residue[255];
- uint_fast8_t do_not_decode[255];
+ uint8_t no_residue[255];
+ uint8_t do_not_decode[255];
vorbis_mapping *mapping;
float *ch_res_ptr = vc->channel_residues;
float *ch_floor_ptr = vc->channel_floors;
- uint_fast8_t res_chan[255];
+ uint8_t res_chan[255];
unsigned res_num = 0;
int retlen = 0;
}
static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
- float *coeffs, uint_fast16_t *posts, int samples)
+ float *coeffs, uint16_t *posts, int samples)
{
int range = 255 / fc->multiplier + 1;
int i;
}
static void floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc,
- PutBitContext *pb, uint_fast16_t *posts,
+ PutBitContext *pb, uint16_t *posts,
float *floor, int samples)
{
int range = 255 / fc->multiplier + 1;
for (i = 0; i < venc->channels; i++) {
vorbis_enc_floor *fc = &venc->floors[mapping->floor[mapping->mux[i]]];
- uint_fast16_t posts[MAX_FLOOR_VALUES];
+ uint16_t posts[MAX_FLOOR_VALUES];
floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
}