Skip to content
Snippets Groups Projects
Commit 5cce4dd7 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

ensure that the bitstream buffers for encoding partitioned frames are aligned

Originally committed as revision 2935 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 38100e8c
No related branches found
No related tags found
No related merge requests found
...@@ -2996,13 +2996,12 @@ void ff_mpeg4_init_partitions(MpegEncContext *s) ...@@ -2996,13 +2996,12 @@ void ff_mpeg4_init_partitions(MpegEncContext *s)
uint8_t *start= pbBufPtr(&s->pb); uint8_t *start= pbBufPtr(&s->pb);
uint8_t *end= s->pb.buf_end; uint8_t *end= s->pb.buf_end;
int size= end - start; int size= end - start;
int pb_size = size/3; int pb_size = (size/3)&(~1);
int pb2_size= size/3; int tex_size= size - 2*pb_size;
int tex_size= size - pb_size - pb2_size;
set_put_bits_buffer_size(&s->pb, pb_size); set_put_bits_buffer_size(&s->pb, pb_size);
init_put_bits(&s->tex_pb, start + pb_size , tex_size); init_put_bits(&s->tex_pb, start + pb_size , tex_size);
init_put_bits(&s->pb2 , start + pb_size + tex_size, pb2_size); init_put_bits(&s->pb2 , start + pb_size + tex_size, pb_size);
} }
void ff_mpeg4_merge_partitions(MpegEncContext *s) void ff_mpeg4_merge_partitions(MpegEncContext *s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment