comparison ac3enc.c @ 234:5fc0c3af3fe4 libavcodec

alternative bitstream writer (disabled by default, uncomment #define ALT_BISTREAM_WRITER in common.h if u want to try it)
author michaelni
date Tue, 12 Feb 2002 15:43:16 +0000
parents 6f0e167504e8
children 289eb941b8ba
comparison
equal deleted inserted replaced
233:3f5b72726118 234:5fc0c3af3fe4
1225 frame_size = s->frame_size; /* frame size in words */ 1225 frame_size = s->frame_size; /* frame size in words */
1226 /* align to 8 bits */ 1226 /* align to 8 bits */
1227 flush_put_bits(&s->pb); 1227 flush_put_bits(&s->pb);
1228 /* add zero bytes to reach the frame size */ 1228 /* add zero bytes to reach the frame size */
1229 frame = s->pb.buf; 1229 frame = s->pb.buf;
1230 n = 2 * s->frame_size - (s->pb.buf_ptr - frame) - 2; 1230 n = 2 * s->frame_size - (pbBufPtr(&s->pb) - frame) - 2;
1231 assert(n >= 0); 1231 assert(n >= 0);
1232 memset(s->pb.buf_ptr, 0, n); 1232 memset(pbBufPtr(&s->pb), 0, n);
1233 1233
1234 /* Now we must compute both crcs : this is not so easy for crc1 1234 /* Now we must compute both crcs : this is not so easy for crc1
1235 because it is at the beginning of the data... */ 1235 because it is at the beginning of the data... */
1236 frame_size_58 = (frame_size >> 1) + (frame_size >> 3); 1236 frame_size_58 = (frame_size >> 1) + (frame_size >> 3);
1237 crc1 = ac3_crc(frame + 4, (2 * frame_size_58) - 4, 0); 1237 crc1 = ac3_crc(frame + 4, (2 * frame_size_58) - 4, 0);