| 1071 | } |
| 1072 | |
| 1073 | static void encode_slice_header(FFV1Context *f, FFV1SliceContext *sc) |
| 1074 | { |
| 1075 | RangeCoder *c = &sc->c; |
| 1076 | uint8_t state[CONTEXT_SIZE]; |
| 1077 | int j; |
| 1078 | memset(state, 128, sizeof(state)); |
| 1079 | |
| 1080 | put_symbol(c, state, sc->sx, 0); |
| 1081 | put_symbol(c, state, sc->sy, 0); |
| 1082 | put_symbol(c, state, 0, 0); |
| 1083 | put_symbol(c, state, 0, 0); |
| 1084 | for (j=0; j<f->plane_count; j++) { |
| 1085 | put_symbol(c, state, sc->plane[j].quant_table_index, 0); |
| 1086 | av_assert0(sc->plane[j].quant_table_index == f->context_model); |
| 1087 | } |
| 1088 | if (!(f->cur_enc_frame->flags & AV_FRAME_FLAG_INTERLACED)) |
| 1089 | put_symbol(c, state, 3, 0); |
| 1090 | else |
| 1091 | put_symbol(c, state, 1 + !(f->cur_enc_frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST), 0); |
| 1092 | put_symbol(c, state, f->cur_enc_frame->sample_aspect_ratio.num, 0); |
| 1093 | put_symbol(c, state, f->cur_enc_frame->sample_aspect_ratio.den, 0); |
| 1094 | if (f->version > 3) { |
| 1095 | put_rac(c, state, sc->slice_coding_mode == 1); |
| 1096 | if (sc->slice_coding_mode == 1) |
| 1097 | ff_ffv1_clear_slice_state(f, sc); |
| 1098 | put_symbol(c, state, sc->slice_coding_mode, 0); |
| 1099 | if (sc->slice_coding_mode != 1 && f->colorspace == 1) { |
| 1100 | put_symbol(c, state, sc->slice_rct_by_coef, 0); |
| 1101 | put_symbol(c, state, sc->slice_rct_ry_coef, 0); |
| 1102 | } |
| 1103 | put_symbol(c, state, sc->remap, 0); |
| 1104 | } |
| 1105 | } |
| 1106 | |
| 1107 | static void choose_rct_params(const FFV1Context *f, FFV1SliceContext *sc, |
| 1108 | const uint8_t *src[3], const int stride[3], int w, int h) |
no test coverage detected