| OLD | NEW |
| 1 /* | 1 /* |
| 2 * ITU H263 bitstream encoder | 2 * ITU H263 bitstream encoder |
| 3 * Copyright (c) 2000,2001 Fabrice Bellard | 3 * Copyright (c) 2000,2001 Fabrice Bellard |
| 4 * H263+ support. | 4 * H263+ support. |
| 5 * Copyright (c) 2001 Juan J. Sierralta P | 5 * Copyright (c) 2001 Juan J. Sierralta P |
| 6 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> | 6 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> |
| 7 * | 7 * |
| 8 * This file is part of FFmpeg. | 8 * This file is part of FFmpeg. |
| 9 * | 9 * |
| 10 * FFmpeg is free software; you can redistribute it and/or | 10 * FFmpeg is free software; you can redistribute it and/or |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 put_bits(&s->pb, 1, 0); /* only I/P frames, no PB frame */ | 155 put_bits(&s->pb, 1, 0); /* only I/P frames, no PB frame */ |
| 156 put_bits(&s->pb, 5, s->qscale); | 156 put_bits(&s->pb, 5, s->qscale); |
| 157 put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode:
off */ | 157 put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode:
off */ |
| 158 } else { | 158 } else { |
| 159 int ufep=1; | 159 int ufep=1; |
| 160 /* H.263v2 */ | 160 /* H.263v2 */ |
| 161 /* H.263 Plus PTYPE */ | 161 /* H.263 Plus PTYPE */ |
| 162 | 162 |
| 163 put_bits(&s->pb, 3, 7); | 163 put_bits(&s->pb, 3, 7); |
| 164 put_bits(&s->pb,3,ufep); /* Update Full Extended PTYPE */ | 164 put_bits(&s->pb,3,ufep); /* Update Full Extended PTYPE */ |
| 165 if (format == 7) | 165 if (format == 8) |
| 166 put_bits(&s->pb,3,6); /* Custom Source Format */ | 166 put_bits(&s->pb,3,6); /* Custom Source Format */ |
| 167 else | 167 else |
| 168 put_bits(&s->pb, 3, format); | 168 put_bits(&s->pb, 3, format); |
| 169 | 169 |
| 170 put_bits(&s->pb,1, s->custom_pcf); | 170 put_bits(&s->pb,1, s->custom_pcf); |
| 171 put_bits(&s->pb,1, s->umvplus); /* Unrestricted Motion Vector */ | 171 put_bits(&s->pb,1, s->umvplus); /* Unrestricted Motion Vector */ |
| 172 put_bits(&s->pb,1,0); /* SAC: off */ | 172 put_bits(&s->pb,1,0); /* SAC: off */ |
| 173 put_bits(&s->pb,1,s->obmc); /* Advanced Prediction Mode */ | 173 put_bits(&s->pb,1,s->obmc); /* Advanced Prediction Mode */ |
| 174 put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */ | 174 put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */ |
| 175 put_bits(&s->pb,1,s->loop_filter); /* Deblocking Filter */ | 175 put_bits(&s->pb,1,s->loop_filter); /* Deblocking Filter */ |
| 176 put_bits(&s->pb,1,s->h263_slice_structured); /* Slice Structured */ | 176 put_bits(&s->pb,1,s->h263_slice_structured); /* Slice Structured */ |
| 177 put_bits(&s->pb,1,0); /* Reference Picture Selection: off */ | 177 put_bits(&s->pb,1,0); /* Reference Picture Selection: off */ |
| 178 put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */ | 178 put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */ |
| 179 put_bits(&s->pb,1,s->alt_inter_vlc); /* Alternative Inter VLC */ | 179 put_bits(&s->pb,1,s->alt_inter_vlc); /* Alternative Inter VLC */ |
| 180 put_bits(&s->pb,1,s->modified_quant); /* Modified Quantization: */ | 180 put_bits(&s->pb,1,s->modified_quant); /* Modified Quantization: */ |
| 181 put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ | 181 put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ |
| 182 put_bits(&s->pb,3,0); /* Reserved */ | 182 put_bits(&s->pb,3,0); /* Reserved */ |
| 183 | 183 |
| 184 put_bits(&s->pb, 3, s->pict_type == FF_P_TYPE); | 184 put_bits(&s->pb, 3, s->pict_type == FF_P_TYPE); |
| 185 | 185 |
| 186 put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */ | 186 put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */ |
| 187 put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */ | 187 put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */ |
| 188 put_bits(&s->pb,1,s->no_rounding); /* Rounding Type */ | 188 put_bits(&s->pb,1,s->no_rounding); /* Rounding Type */ |
| 189 put_bits(&s->pb,2,0); /* Reserved */ | 189 put_bits(&s->pb,2,0); /* Reserved */ |
| 190 put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ | 190 put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ |
| 191 | 191 |
| 192 /* This should be here if PLUSPTYPE */ | 192 /* This should be here if PLUSPTYPE */ |
| 193 put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */ | 193 put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */ |
| 194 | 194 |
| 195 if (format == 7) { | 195 if (format == 8) { |
| 196 /* Custom Picture Format (CPFMT) */ | 196 /* Custom Picture Format (CPFMT) */ |
| 197 s->aspect_ratio_info= ff_h263_aspect_to_info(s->avctx->sample_aspect
_ratio); | 197 s->aspect_ratio_info= ff_h263_aspect_to_info(s->avctx->sample_aspect
_ratio); |
| 198 | 198 |
| 199 put_bits(&s->pb,4,s->aspect_ratio_info); | 199 put_bits(&s->pb,4,s->aspect_ratio_info); |
| 200 put_bits(&s->pb,9,(s->width >> 2) - 1); | 200 put_bits(&s->pb,9,(s->width >> 2) - 1); |
| 201 put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ | 201 put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ |
| 202 put_bits(&s->pb,9,(s->height >> 2)); | 202 put_bits(&s->pb,9,(s->height >> 2)); |
| 203 if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){ | 203 if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){ |
| 204 put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num); | 204 put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num); |
| 205 put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den); | 205 put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den); |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 void ff_h263_encode_mba(MpegEncContext *s) | 833 void ff_h263_encode_mba(MpegEncContext *s) |
| 834 { | 834 { |
| 835 int i, mb_pos; | 835 int i, mb_pos; |
| 836 | 836 |
| 837 for(i=0; i<6; i++){ | 837 for(i=0; i<6; i++){ |
| 838 if(s->mb_num-1 <= ff_mba_max[i]) break; | 838 if(s->mb_num-1 <= ff_mba_max[i]) break; |
| 839 } | 839 } |
| 840 mb_pos= s->mb_x + s->mb_width*s->mb_y; | 840 mb_pos= s->mb_x + s->mb_width*s->mb_y; |
| 841 put_bits(&s->pb, ff_mba_length[i], mb_pos); | 841 put_bits(&s->pb, ff_mba_length[i], mb_pos); |
| 842 } | 842 } |
| OLD | NEW |