Mercurial > libavcodec.hg
comparison mpegvideo.c @ 1838:8cdbb74c2f4b libavcodec
10l (vdpart fix)
author | michael |
---|---|
date | Thu, 26 Feb 2004 19:11:21 +0000 |
parents | 41c324b09fcc |
children | 0d82db458a3c |
comparison
equal
deleted
inserted
replaced
1837:a4d9e8b4e2f8 | 1838:8cdbb74c2f4b |
---|---|
406 } | 406 } |
407 | 407 |
408 static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){ | 408 static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){ |
409 int i; | 409 int i; |
410 | 410 |
411 // edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21 for h264) | |
411 CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*17*2); //(width + edge + align)*interlaced*MBsize*tolerance | 412 CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*17*2); //(width + edge + align)*interlaced*MBsize*tolerance |
412 s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*17; | 413 s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*17; |
413 | 414 |
414 //FIXME should be linesize instead of s->width*2 but that isnt known before get_buffer() | 415 //FIXME should be linesize instead of s->width*2 but that isnt known before get_buffer() |
415 CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*2*16*2*sizeof(uint8_t)) | 416 CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*2*16*2*sizeof(uint8_t)) |
2017 av_log(avctx, AV_LOG_ERROR, "this codec supports only YUV420P\n"); | 2018 av_log(avctx, AV_LOG_ERROR, "this codec supports only YUV420P\n"); |
2018 return -1; | 2019 return -1; |
2019 } | 2020 } |
2020 | 2021 |
2021 for(i=0; i<avctx->thread_count; i++){ | 2022 for(i=0; i<avctx->thread_count; i++){ |
2022 int y= s->thread_context[i]->start_mb_y; | 2023 int start_y= s->thread_context[i]->start_mb_y; |
2024 int end_y= s->thread_context[i]-> end_mb_y; | |
2023 int h= s->mb_height; | 2025 int h= s->mb_height; |
2024 uint8_t *start= buf + buf_size* y /h; | 2026 uint8_t *start= buf + buf_size*start_y/h; |
2025 uint8_t *end = buf + buf_size*(y+1)/h; | 2027 uint8_t *end = buf + buf_size* end_y/h; |
2026 | 2028 |
2027 init_put_bits(&s->thread_context[i]->pb, start, end - start); | 2029 init_put_bits(&s->thread_context[i]->pb, start, end - start); |
2028 } | 2030 } |
2029 | 2031 |
2030 s->picture_in_gop_number++; | 2032 s->picture_in_gop_number++; |