summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-03-30 16:22:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-03-30 16:22:08 +0000
commit5acaa5e1df0a6a9da5c87ba6edd7b0d8c4e95c88 (patch)
treecc720c16fde36007d23140aa2c9297a8378b0304 /libavcodec
parent3c300082de6d822e23f08e7e08d8091c8fc6723e (diff)
simplify slice encoding (variance of packet size is practically identical)
Originally committed as revision 1719 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c16
-rw-r--r--libavcodec/mpegvideo.h2
2 files changed, 2 insertions, 16 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 46b44f3786..7f7730b1d2 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -3043,7 +3043,6 @@ static void encode_picture(MpegEncContext *s, int picture_number)
s->resync_mb_y=0;
s->first_slice_line = 1;
s->ptr_lastgob = s->pb.buf;
- s->ptr_last_mb_line = s->pb.buf;
for(mb_y=0; mb_y < s->mb_height; mb_y++) {
s->y_dc_scale= s->y_dc_scale_table[ s->qscale ];
s->c_dc_scale= s->c_dc_scale_table[ s->qscale ];
@@ -3078,7 +3077,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
is_gob_start=0;
if(s->codec_id==CODEC_ID_MPEG4){
- if(current_packet_size + s->mb_line_avgsize/s->mb_width >= s->rtp_payload_size
+ if(current_packet_size >= s->rtp_payload_size
&& s->mb_y + s->mb_x>0){
if(s->partitioned_frame){
@@ -3096,7 +3095,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
is_gob_start=1;
}
}else{
- if(current_packet_size + s->mb_line_avgsize*s->gob_index >= s->rtp_payload_size
+ if(current_packet_size >= s->rtp_payload_size
&& s->mb_x==0 && s->mb_y>0 && s->mb_y%s->gob_index==0){
h263_encode_gob_header(s, mb_y);
@@ -3411,17 +3410,6 @@ static void encode_picture(MpegEncContext *s, int picture_number)
}
//printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_width, get_bit_count(&s->pb));
}
-
-
- /* Obtain average mb_row size for RTP */
- if (s->rtp_mode) {
- if (mb_y==0)
- s->mb_line_avgsize = pbBufPtr(&s->pb) - s->ptr_last_mb_line;
- else {
- s->mb_line_avgsize = (s->mb_line_avgsize + pbBufPtr(&s->pb) - s->ptr_last_mb_line) >> 1;
- }
- s->ptr_last_mb_line = pbBufPtr(&s->pb);
- }
}
emms_c();
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index eb45fe7b70..924daac92c 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -578,8 +578,6 @@ typedef struct MpegEncContext {
int rtp_payload_size;
void (*rtp_callback)(void *data, int size, int packet_number);
uint8_t *ptr_lastgob;
- uint8_t *ptr_last_mb_line;
- uint32_t mb_line_avgsize;
DCTELEM (*block)[64]; ///< points to one of the following blocks
DCTELEM blocks[2][6][64] __align8; // for HQ mode we need to keep the best block