Commit ebe587ae authored by michaelni's avatar michaelni

mpeg2 field pictures + sliced mode (doesnt work with mplayer though, dunno why)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1626 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent eca547d3
...@@ -213,7 +213,7 @@ static int decode_slice(MpegEncContext *s){ ...@@ -213,7 +213,7 @@ static int decode_slice(MpegEncContext *s){
if(++s->mb_x >= s->mb_width){ if(++s->mb_x >= s->mb_width){
s->mb_x=0; s->mb_x=0;
ff_draw_horiz_band(s); ff_draw_horiz_band(s, s->mb_y*16, 16);
s->mb_y++; s->mb_y++;
} }
return 0; return 0;
...@@ -230,7 +230,7 @@ static int decode_slice(MpegEncContext *s){ ...@@ -230,7 +230,7 @@ static int decode_slice(MpegEncContext *s){
} }
} }
ff_draw_horiz_band(s); ff_draw_horiz_band(s, s->mb_y*16, 16);
s->mb_x= 0; s->mb_x= 0;
} }
......
...@@ -1875,7 +1875,13 @@ static int mpeg_decode_slice(AVCodecContext *avctx, ...@@ -1875,7 +1875,13 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
} }
if (++s->mb_x >= s->mb_width) { if (++s->mb_x >= s->mb_width) {
ff_draw_horiz_band(s); if(s->picture_structure==PICT_FRAME){
ff_draw_horiz_band(s, 16*s->mb_y, 16);
}else{
if(!s->first_field){
ff_draw_horiz_band(s, 32*s->mb_y, 32);
}
}
s->mb_x = 0; s->mb_x = 0;
s->mb_y++; s->mb_y++;
......
...@@ -2051,7 +2051,7 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) ...@@ -2051,7 +2051,7 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
}else }else
s->mb_skiped= 0; s->mb_skiped= 0;
if(s->pict_type==B_TYPE && s->avctx->draw_horiz_band){ if(s->pict_type==B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME){ //FIXME precalc
dest_y = s->current_picture.data[0] + mb_x * 16; dest_y = s->current_picture.data[0] + mb_x * 16;
dest_cb = s->current_picture.data[1] + mb_x * 8; dest_cb = s->current_picture.data[1] + mb_x * 8;
dest_cr = s->current_picture.data[2] + mb_x * 8; dest_cr = s->current_picture.data[2] + mb_x * 8;
...@@ -2356,17 +2356,18 @@ static int pix_diff_vcmp16x8(uint8_t *s1, uint8_t*s2, int stride){ //FIXME move ...@@ -2356,17 +2356,18 @@ static int pix_diff_vcmp16x8(uint8_t *s1, uint8_t*s2, int stride){ //FIXME move
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS
void ff_draw_horiz_band(MpegEncContext *s){ /**
*
* @param h is the normal height, this will be reduced automatically if needed for the last row
*/
void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
if ( s->avctx->draw_horiz_band if ( s->avctx->draw_horiz_band
&& (s->last_picture.data[0] || s->low_delay) ) { && (s->last_picture.data[0] || s->low_delay) ) {
uint8_t *src_ptr[3]; uint8_t *src_ptr[3];
int y, h, offset; int offset;
y = s->mb_y * 16; h= FFMIN(h, s->height - y);
h = s->height - y;
if (h > 16)
h = 16;
if(s->pict_type==B_TYPE) if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME)
offset = 0; offset = 0;
else else
offset = y * s->linesize; offset = y * s->linesize;
......
...@@ -593,7 +593,7 @@ void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length); ...@@ -593,7 +593,7 @@ void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length);
void ff_clean_intra_table_entries(MpegEncContext *s); void ff_clean_intra_table_entries(MpegEncContext *s);
void ff_init_scantable(MpegEncContext *s, ScanTable *st, const uint8_t *src_scantable); void ff_init_scantable(MpegEncContext *s, ScanTable *st, const uint8_t *src_scantable);
void ff_error_resilience(MpegEncContext *s); void ff_error_resilience(MpegEncContext *s);
void ff_draw_horiz_band(MpegEncContext *s); void ff_draw_horiz_band(MpegEncContext *s, int y, int h);
void ff_emulated_edge_mc(MpegEncContext *s, uint8_t *src, int linesize, int block_w, int block_h, void ff_emulated_edge_mc(MpegEncContext *s, uint8_t *src, int linesize, int block_w, int block_h,
int src_x, int src_y, int w, int h); int src_x, int src_y, int w, int h);
char ff_get_pict_type_char(int pict_type); char ff_get_pict_type_char(int pict_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment