Mercurial > libavcodec.hg
comparison dv.c @ 8050:4eac1822bc65 libavcodec
spelling cosmetics
author | diego |
---|---|
date | Fri, 24 Oct 2008 21:37:06 +0000 |
parents | 07d8986fbea7 |
children | fed91eaa6444 |
comparison
equal
deleted
inserted
replaced
8049:611a21e4b01b | 8050:4eac1822bc65 |
---|---|
136 uint8_t new_dv_vlc_run[NB_DV_VLC*2]; | 136 uint8_t new_dv_vlc_run[NB_DV_VLC*2]; |
137 int16_t new_dv_vlc_level[NB_DV_VLC*2]; | 137 int16_t new_dv_vlc_level[NB_DV_VLC*2]; |
138 | 138 |
139 done = 1; | 139 done = 1; |
140 | 140 |
141 /* dv_anchor lets each thread know its Id */ | 141 /* dv_anchor lets each thread know its ID */ |
142 for (i=0; i<DV_ANCHOR_SIZE; i++) | 142 for (i=0; i<DV_ANCHOR_SIZE; i++) |
143 dv_anchor[i] = (void*)(size_t)i; | 143 dv_anchor[i] = (void*)(size_t)i; |
144 | 144 |
145 /* it's faster to include sign bit in a generic VLC parsing scheme */ | 145 /* it's faster to include sign bit in a generic VLC parsing scheme */ |
146 for (i=0, j=0; i<NB_DV_VLC; i++, j++) { | 146 for (i=0, j=0; i<NB_DV_VLC; i++, j++) { |
965 if (enc_blks[i+j].partial_bit_count) | 965 if (enc_blks[i+j].partial_bit_count) |
966 pb=dv_encode_ac(&enc_blks[i+j], pb, &pbs[j+6]); | 966 pb=dv_encode_ac(&enc_blks[i+j], pb, &pbs[j+6]); |
967 } | 967 } |
968 } | 968 } |
969 | 969 |
970 /* Third and final pass over the whole vides segment space */ | 970 /* Third and final pass over the whole video segment space */ |
971 pb= &pbs[0]; | 971 pb= &pbs[0]; |
972 for (j=0; j<5*6; j++) { | 972 for (j=0; j<5*6; j++) { |
973 if (enc_blks[j].partial_bit_count) | 973 if (enc_blks[j].partial_bit_count) |
974 pb=dv_encode_ac(&enc_blks[j], pb, &pbs[6*5]); | 974 pb=dv_encode_ac(&enc_blks[j], pb, &pbs[6*5]); |
975 if (enc_blks[j].partial_bit_count) | 975 if (enc_blks[j].partial_bit_count) |
1117 break; | 1117 break; |
1118 case dv_video_source: | 1118 case dv_video_source: |
1119 buf[1] = 0xff; /* reserved -- always 1 */ | 1119 buf[1] = 0xff; /* reserved -- always 1 */ |
1120 buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */ | 1120 buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */ |
1121 (1 << 6) | /* following CLF is valid - 0, invalid - 1 */ | 1121 (1 << 6) | /* following CLF is valid - 0, invalid - 1 */ |
1122 (3 << 4) | /* CLF: color frames id (see ITU-R BT.470-4) */ | 1122 (3 << 4) | /* CLF: color frames ID (see ITU-R BT.470-4) */ |
1123 0xf; /* reserved -- always 1 */ | 1123 0xf; /* reserved -- always 1 */ |
1124 buf[3] = (3 << 6) | /* reserved -- always 1 */ | 1124 buf[3] = (3 << 6) | /* reserved -- always 1 */ |
1125 (c->sys->dsf << 5) | /* system: 60fields/50fields */ | 1125 (c->sys->dsf << 5) | /* system: 60fields/50fields */ |
1126 stype; /* signal type video compression */ | 1126 stype; /* signal type video compression */ |
1127 buf[4] = 0xff; /* VISC: 0xff -- no information */ | 1127 buf[4] = 0xff; /* VISC: 0xff -- no information */ |
1129 case dv_video_control: | 1129 case dv_video_control: |
1130 buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */ | 1130 buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */ |
1131 0x3f; /* reserved -- always 1 */ | 1131 0x3f; /* reserved -- always 1 */ |
1132 buf[2] = 0xc8 | /* reserved -- always b11001xxx */ | 1132 buf[2] = 0xc8 | /* reserved -- always b11001xxx */ |
1133 aspect; | 1133 aspect; |
1134 buf[3] = (1 << 7) | /* Frame/field flag 1 -- frame, 0 -- field */ | 1134 buf[3] = (1 << 7) | /* frame/field flag 1 -- frame, 0 -- field */ |
1135 (1 << 6) | /* First/second field flag 0 -- field 2, 1 -- field 1 */ | 1135 (1 << 6) | /* first/second field flag 0 -- field 2, 1 -- field 1 */ |
1136 (1 << 5) | /* Frame change flag 0 -- same picture as before, 1 -- different */ | 1136 (1 << 5) | /* frame change flag 0 -- same picture as before, 1 -- different */ |
1137 (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */ | 1137 (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */ |
1138 0xc; /* reserved -- always b1100 */ | 1138 0xc; /* reserved -- always b1100 */ |
1139 buf[4] = 0xff; /* reserved -- always 1 */ | 1139 buf[4] = 0xff; /* reserved -- always 1 */ |
1140 break; | 1140 break; |
1141 default: | 1141 default: |
1149 { | 1149 { |
1150 int chan, i, j, k; | 1150 int chan, i, j, k; |
1151 | 1151 |
1152 for (chan = 0; chan < c->sys->n_difchan; chan++) { | 1152 for (chan = 0; chan < c->sys->n_difchan; chan++) { |
1153 for (i = 0; i < c->sys->difseg_size; i++) { | 1153 for (i = 0; i < c->sys->difseg_size; i++) { |
1154 memset(buf, 0xff, 80 * 6); /* First 6 DIF blocks are for control data */ | 1154 memset(buf, 0xff, 80 * 6); /* first 6 DIF blocks are for control data */ |
1155 | 1155 |
1156 /* DV header: 1DIF */ | 1156 /* DV header: 1DIF */ |
1157 buf += dv_write_dif_id(dv_sect_header, chan, i, 0, buf); | 1157 buf += dv_write_dif_id(dv_sect_header, chan, i, 0, buf); |
1158 buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525), c, buf); | 1158 buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525), c, buf); |
1159 buf += 72; /* unused bytes */ | 1159 buf += 72; /* unused bytes */ |