| OLD | NEW |
| 1 /* | 1 /* |
| 2 * The simplest mpeg encoder (well, it was the simplest!) | 2 * The simplest mpeg encoder (well, it was the simplest!) |
| 3 * Copyright (c) 2000,2001 Fabrice Bellard | 3 * Copyright (c) 2000,2001 Fabrice Bellard |
| 4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> | 4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> |
| 5 * | 5 * |
| 6 * 4MV & hq & B-frame encoding stuff by Michael Niedermayer <michaelni@gmx.at> | 6 * 4MV & hq & B-frame encoding stuff by Michael Niedermayer <michaelni@gmx.at> |
| 7 * | 7 * |
| 8 * This file is part of FFmpeg. | 8 * This file is part of FFmpeg. |
| 9 * | 9 * |
| 10 * FFmpeg is free software; you can redistribute it and/or | 10 * FFmpeg is free software; you can redistribute it and/or |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 av_log(s->avctx, AV_LOG_ERROR, "decoding to PIX_FMT_NONE is not supporte
d.\n"); | 583 av_log(s->avctx, AV_LOG_ERROR, "decoding to PIX_FMT_NONE is not supporte
d.\n"); |
| 584 return -1; | 584 return -1; |
| 585 } | 585 } |
| 586 | 586 |
| 587 if(s->avctx->active_thread_type&FF_THREAD_SLICE && | 587 if(s->avctx->active_thread_type&FF_THREAD_SLICE && |
| 588 (s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_
height && s->mb_height))){ | 588 (s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_
height && s->mb_height))){ |
| 589 av_log(s->avctx, AV_LOG_ERROR, "too many threads\n"); | 589 av_log(s->avctx, AV_LOG_ERROR, "too many threads\n"); |
| 590 return -1; | 590 return -1; |
| 591 } | 591 } |
| 592 | 592 |
| 593 if((s->width || s->height) && av_check_image_size(s->width, s->height, 0, s-
>avctx)) | 593 if((s->width || s->height) && av_image_check_size(s->width, s->height, 0, s-
>avctx)) |
| 594 return -1; | 594 return -1; |
| 595 | 595 |
| 596 dsputil_init(&s->dsp, s->avctx); | 596 dsputil_init(&s->dsp, s->avctx); |
| 597 ff_dct_common_init(s); | 597 ff_dct_common_init(s); |
| 598 | 598 |
| 599 s->flags= s->avctx->flags; | 599 s->flags= s->avctx->flags; |
| 600 s->flags2= s->avctx->flags2; | 600 s->flags2= s->avctx->flags2; |
| 601 | 601 |
| 602 s->mb_width = (s->width + 15) / 16; | 602 s->mb_width = (s->width + 15) / 16; |
| 603 s->mb_stride = s->mb_width + 1; | 603 s->mb_stride = s->mb_width + 1; |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 else if (s->pict_type != FF_B_TYPE) | 1045 else if (s->pict_type != FF_B_TYPE) |
| 1046 pic->reference = 3; | 1046 pic->reference = 3; |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 pic->coded_picture_number= s->coded_picture_number++; | 1049 pic->coded_picture_number= s->coded_picture_number++; |
| 1050 | 1050 |
| 1051 if(ff_alloc_picture(s, pic, 0) < 0) | 1051 if(ff_alloc_picture(s, pic, 0) < 0) |
| 1052 return -1; | 1052 return -1; |
| 1053 | 1053 |
| 1054 s->current_picture_ptr= pic; | 1054 s->current_picture_ptr= pic; |
| 1055 s->current_picture_ptr->top_field_first= s->top_field_first; //FIXME use
only the vars from current_pic | 1055 //FIXME use only the vars from current_pic |
| 1056 if(s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VI
DEO) { |
| 1057 if(s->picture_structure == PICT_FRAME) |
| 1058 s->current_picture_ptr->top_field_first= s->top_field_first; |
| 1059 else |
| 1060 s->current_picture_ptr->top_field_first= (s->picture_structure =
= PICT_TOP_FIELD) == s->first_field; |
| 1061 } else |
| 1062 s->current_picture_ptr->top_field_first= s->top_field_first; |
| 1056 s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->p
rogressive_sequence; | 1063 s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->p
rogressive_sequence; |
| 1057 s->current_picture_ptr->field_picture= s->picture_structure != PICT_FRAM
E; | 1064 s->current_picture_ptr->field_picture= s->picture_structure != PICT_FRAM
E; |
| 1058 } | 1065 } |
| 1059 | 1066 |
| 1060 s->current_picture_ptr->pict_type= s->pict_type; | 1067 s->current_picture_ptr->pict_type= s->pict_type; |
| 1061 // if(s->flags && CODEC_FLAG_QSCALE) | 1068 // if(s->flags && CODEC_FLAG_QSCALE) |
| 1062 // s->current_picture_ptr->quality= s->new_picture_ptr->quality; | 1069 // s->current_picture_ptr->quality= s->new_picture_ptr->quality; |
| 1063 s->current_picture_ptr->key_frame= s->pict_type == FF_I_TYPE; | 1070 s->current_picture_ptr->key_frame= s->pict_type == FF_I_TYPE; |
| 1064 | 1071 |
| 1065 ff_copy_picture(&s->current_picture, s->current_picture_ptr); | 1072 ff_copy_picture(&s->current_picture, s->current_picture_ptr); |
| (...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2583 | 2590 |
| 2584 s->y_dc_scale= s->y_dc_scale_table[ qscale ]; | 2591 s->y_dc_scale= s->y_dc_scale_table[ qscale ]; |
| 2585 s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ]; | 2592 s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ]; |
| 2586 } | 2593 } |
| 2587 | 2594 |
| 2588 void MPV_report_decode_progress(MpegEncContext *s) | 2595 void MPV_report_decode_progress(MpegEncContext *s) |
| 2589 { | 2596 { |
| 2590 if (s->pict_type != FF_B_TYPE && !s->partitioned_frame) | 2597 if (s->pict_type != FF_B_TYPE && !s->partitioned_frame) |
| 2591 ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); | 2598 ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); |
| 2592 } | 2599 } |
| OLD | NEW |