int dec_debug = 0;
#endif
-static int read_le32(const uint8_t *p) {
- return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
+static int read_be32(const uint8_t *p) {
+ return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}
// len == 0 is not allowed
data_ptr2[0][0] = data_ptr;
for (tile_row = 0; tile_row < pc->tile_rows; tile_row++) {
if (tile_row) {
- const int size = read_le32(data_ptr2[tile_row - 1][n_cols - 1]);
+ const int size = read_be32(data_ptr2[tile_row - 1][n_cols - 1]);
data_ptr2[tile_row - 1][n_cols - 1] += 4;
data_ptr2[tile_row][0] = data_ptr2[tile_row - 1][n_cols - 1] + size;
}
for (tile_col = 1; tile_col < n_cols; tile_col++) {
- const int size = read_le32(data_ptr2[tile_row][tile_col - 1]);
+ const int size = read_be32(data_ptr2[tile_row][tile_col - 1]);
data_ptr2[tile_row][tile_col - 1] += 4;
data_ptr2[tile_row][tile_col] =
data_ptr2[tile_row][tile_col - 1] + size;
decode_tile(pbi, residual_bc);
if (has_more) {
- const int size = read_le32(data_ptr);
+ const int size = read_be32(data_ptr);
data_ptr += 4 + size;
}
}
static int update_bits[255];
-static INLINE void write_le32(uint8_t *p, int value) {
- p[0] = value;
- p[1] = value >> 8;
- p[2] = value >> 16;
- p[3] = value >> 24;
+static INLINE void write_be32(uint8_t *p, int value) {
+ p[0] = value >> 24;
+ p[1] = value >> 16;
+ p[2] = value >> 8;
+ p[3] = value;
}
vp9_stop_encode(&residual_bc);
if (tile_col < pc->tile_columns - 1 || tile_row < pc->tile_rows - 1) {
// size of this tile
- write_le32(data_ptr + total_size, residual_bc.pos);
+ write_be32(data_ptr + total_size, residual_bc.pos);
total_size += 4;
}