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 |
11 * modify it under the terms of the GNU Lesser General Public | 11 * modify it under the terms of the GNU Lesser General Public |
12 * License as published by the Free Software Foundation; either | 12 * License as published by the Free Software Foundation; either |
13 * version 2.1 of the License, or (at your option) any later version. | 13 * version 2.1 of the License, or (at your option) any later version. |
14 * | 14 * |
15 * FFmpeg is distributed in the hope that it will be useful, | 15 * FFmpeg is distributed in the hope that it will be useful, |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 * Lesser General Public License for more details. | 18 * Lesser General Public License for more details. |
19 * | 19 * |
20 * You should have received a copy of the GNU Lesser General Public | 20 * You should have received a copy of the GNU Lesser General Public |
21 * License along with FFmpeg; if not, write to the Free Software | 21 * License along with FFmpeg; if not, write to the Free Software |
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
23 */ | 23 */ |
24 | 24 |
25 /** | 25 /** |
26 * @file libavcodec/mpegvideo_enc.c | 26 * @file libavcodec/mpegvideo_enc.c |
27 * The simplest mpeg encoder (well, it was the simplest!). | 27 * The simplest mpeg encoder (well, it was the simplest!). |
28 */ | 28 */ |
29 | 29 |
| 30 #include "libavutil/intmath.h" |
30 #include "avcodec.h" | 31 #include "avcodec.h" |
31 #include "dsputil.h" | 32 #include "dsputil.h" |
32 #include "mpegvideo.h" | 33 #include "mpegvideo.h" |
33 #include "mpegvideo_common.h" | 34 #include "mpegvideo_common.h" |
34 #include "h263.h" | 35 #include "h263.h" |
35 #include "mjpegenc.h" | 36 #include "mjpegenc.h" |
36 #include "msmpeg4.h" | 37 #include "msmpeg4.h" |
37 #include "faandct.h" | 38 #include "faandct.h" |
38 #include "thread.h" | 39 #include "thread.h" |
39 #include "aandcttab.h" | 40 #include "aandcttab.h" |
(...skipping 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 } | 3307 } |
3307 } | 3308 } |
3308 } | 3309 } |
3309 } | 3310 } |
3310 } | 3311 } |
3311 | 3312 |
3312 static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise? | 3313 static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise? |
3313 DCTELEM *block, int16_t *weight, DCTELEM *orig, | 3314 DCTELEM *block, int16_t *weight, DCTELEM *orig, |
3314 int n, int qscale){ | 3315 int n, int qscale){ |
3315 int16_t rem[64]; | 3316 int16_t rem[64]; |
3316 DECLARE_ALIGNED_16(DCTELEM, d1)[64]; | 3317 LOCAL_ALIGNED_16(DCTELEM, d1, [64]); |
3317 const uint8_t *scantable= s->intra_scantable.scantable; | 3318 const uint8_t *scantable= s->intra_scantable.scantable; |
3318 const uint8_t *perm_scantable= s->intra_scantable.permutated; | 3319 const uint8_t *perm_scantable= s->intra_scantable.permutated; |
3319 // unsigned int threshold1, threshold2; | 3320 // unsigned int threshold1, threshold2; |
3320 // int bias=0; | 3321 // int bias=0; |
3321 int run_tab[65]; | 3322 int run_tab[65]; |
3322 int prev_run=0; | 3323 int prev_run=0; |
3323 int prev_level=0; | 3324 int prev_level=0; |
3324 int qmul, qadd, start_i, last_non_zero, i, dc; | 3325 int qmul, qadd, start_i, last_non_zero, i, dc; |
3325 uint8_t * length; | 3326 uint8_t * length; |
3326 uint8_t * last_length; | 3327 uint8_t * last_length; |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 "wmv1", | 3827 "wmv1", |
3827 CODEC_TYPE_VIDEO, | 3828 CODEC_TYPE_VIDEO, |
3828 CODEC_ID_WMV1, | 3829 CODEC_ID_WMV1, |
3829 sizeof(MpegEncContext), | 3830 sizeof(MpegEncContext), |
3830 MPV_encode_init, | 3831 MPV_encode_init, |
3831 MPV_encode_picture, | 3832 MPV_encode_picture, |
3832 MPV_encode_end, | 3833 MPV_encode_end, |
3833 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 3834 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
3834 .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"), | 3835 .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"), |
3835 }; | 3836 }; |
OLD | NEW |