Mercurial > mplayer.hg
annotate libmpcodecs/ve_x264.c @ 19158:6373c98ada45
don't do the work of mp_get_mp3_header() and, as a side effect, prevent a deadlock due to a missed cnt++
author | nicodvb |
---|---|
date | Sun, 23 Jul 2006 07:52:51 +0000 |
parents | 9b4f87f86bec |
children | 7e19b1207b81 |
rev | line source |
---|---|
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
1 /***************************************************************************** |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
2 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
3 * - H.264 encoder for mencoder using x264 - |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
4 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
5 * Copyright (C) 2004 LINUX4MEDIA GmbH |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
6 * Copyright (C) 2004 Ark Linux |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
7 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
8 * Written by Bernhard Rosenkraenzer <bero@arklinux.org> |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
9 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License version 2 as |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
12 * published by the Free Software Foundation, or if, and only if, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
13 * version 2 is ruled invalid in a court of law, any later version |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
14 * of the GNU General Public License published by the Free Software |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
15 * Foundation. |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
16 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
19 * MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
21 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
25 * |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
26 *****************************************************************************/ |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
27 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
28 #include <stdio.h> |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
29 #include <stdlib.h> |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
30 #include <string.h> |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
31 #include <errno.h> |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
32 |
17012 | 33 #include "config.h" |
34 #include "mp_msg.h" | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
35 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
36 #include "m_option.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
37 #include "codec-cfg.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
38 #include "stream.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
39 #include "demuxer.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
40 #include "stheader.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
41 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
42 #include "muxer.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
43 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
44 #include "img_format.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
45 #include "mp_image.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
46 #include "vf.h" |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
47 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
48 #include <x264.h> |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
49 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
50 typedef struct _h264_module_t { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
51 muxer_stream_t *mux; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
52 x264_param_t param; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
53 x264_t * x264; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
54 x264_picture_t pic; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
55 } h264_module_t; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
56 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
57 extern char* passtmpfile; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
58 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
59 static int bitrate = -1; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
60 static int qp_constant = 26; |
16846 | 61 static int rf_constant = 0; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
62 static int frame_ref = 1; |
14468 | 63 static int keyint_max = 250; |
15413 | 64 static int keyint_min = 25; |
13584
17cb9c6a99f6
Adds a parameter 'scenecut', to control the threshold for inserting extra I-frames.
iive
parents:
13496
diff
changeset
|
65 static int scenecut_threshold = 40; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
66 static int bframe = 0; |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
67 static int bframe_adaptive = 1; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
68 static int bframe_bias = 0; |
14916 | 69 static int bframe_pyramid = 0; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
70 static int deblock = 1; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
71 static int deblockalpha = 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
72 static int deblockbeta = 0; |
13496
0bdcb3eea569
better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.
iive
parents:
13431
diff
changeset
|
73 static int cabac = 1; |
13965 | 74 static int p4x4mv = 0; |
14468 | 75 static int p8x8mv = 1; |
14257 | 76 static int b8x8mv = 1; |
15654 | 77 static int i8x8 = 1; |
78 static int i4x4 = 1; | |
79 static int dct8 = 0; | |
17731 | 80 static int direct_pred = X264_DIRECT_PRED_SPATIAL; |
14759
8c1d40548612
Sync to x264 r134: weighted prediction for B-frames.
lorenm
parents:
14738
diff
changeset
|
81 static int weight_b = 0; |
14943 | 82 static int chroma_me = 1; |
16712 | 83 static int mixed_references = 0; |
14943 | 84 static int chroma_qp_offset = 0; |
13965 | 85 static float ip_factor = 1.4; |
14257 | 86 static float pb_factor = 1.3; |
15413 | 87 static float ratetol = 1.0; |
88 static int vbv_maxrate = 0; | |
89 static int vbv_bufsize = 0; | |
90 static float vbv_init = 0.9; | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
91 static int qp_min = 10; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
92 static int qp_max = 51; |
15413 | 93 static int qp_step = 2; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
94 static int pass = 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
95 static float qcomp = 0.6; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
96 static float qblur = 0.5; |
13965 | 97 static float complexity_blur = 20; |
14719 | 98 static char *rc_eq = "blurCplx^(1-qComp)"; |
15557
40d5e0ccce93
sync to x264 r239 (zoned ratecontrol and UMHex ME)
lorenm
parents:
15413
diff
changeset
|
99 static char *zones = NULL; |
14411
fba04febec4e
x264: disable subq=0 (the huge bitrate penalty wasn't worth the speed),
lorenm
parents:
14307
diff
changeset
|
100 static int subq = 5; |
17025 | 101 static int bframe_rdo = 0; |
17268 | 102 static int bidir_me = 0; |
15352 | 103 static int me_method = 2; |
104 static int me_range = 16; | |
16898 | 105 static int trellis = 1; |
17402 | 106 static int fast_pskip = 1; |
18207 | 107 static int dct_decimate = 1; |
17402 | 108 static int noise_reduction = 0; |
15590 | 109 static int threads = 1; |
17026 | 110 static int level_idc = 51; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
111 static int psnr = 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
112 static int log_level = 2; |
15964
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
113 static int turbo = 0; |
16016 | 114 static int visualize = 0; |
16366
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
115 static char *cqm = NULL; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
116 static char *cqm4iy = NULL; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
117 static char *cqm4ic = NULL; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
118 static char *cqm4py = NULL; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
119 static char *cqm4pc = NULL; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
120 static char *cqm8iy = NULL; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
121 static char *cqm8py = NULL; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
122 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
123 m_option_t x264encopts_conf[] = { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
124 {"bitrate", &bitrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, |
15744 | 125 {"qp_constant", &qp_constant, CONF_TYPE_INT, CONF_RANGE, 0, 51, NULL}, |
16846 | 126 {"qp", &qp_constant, CONF_TYPE_INT, CONF_RANGE, 0, 51, NULL}, |
127 {"crf", &rf_constant, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL}, | |
14943 | 128 {"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 16, NULL}, |
14468 | 129 {"keyint", &keyint_max, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL}, |
130 {"keyint_min", &keyint_min, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL}, | |
13584
17cb9c6a99f6
Adds a parameter 'scenecut', to control the threshold for inserting extra I-frames.
iive
parents:
13496
diff
changeset
|
131 {"scenecut", &scenecut_threshold, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL}, |
13496
0bdcb3eea569
better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.
iive
parents:
13431
diff
changeset
|
132 {"bframes", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL}, |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
133 {"b_adapt", &bframe_adaptive, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
134 {"nob_adapt", &bframe_adaptive, CONF_TYPE_FLAG, 0, 1, 0, NULL}, |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
135 {"b_bias", &bframe_bias, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, |
14916 | 136 {"b_pyramid", &bframe_pyramid, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
137 {"nob_pyramid", &bframe_pyramid, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
13496
0bdcb3eea569
better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.
iive
parents:
13431
diff
changeset
|
138 {"deblock", &deblock, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
0bdcb3eea569
better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.
iive
parents:
13431
diff
changeset
|
139 {"nodeblock", &deblock, CONF_TYPE_FLAG, 0, 1, 0, NULL}, |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
140 {"deblockalpha", &deblockalpha, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL}, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
141 {"deblockbeta", &deblockbeta, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL}, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
142 {"cabac", &cabac, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
13496
0bdcb3eea569
better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.
iive
parents:
13431
diff
changeset
|
143 {"nocabac", &cabac, CONF_TYPE_FLAG, 0, 1, 0, NULL}, |
13965 | 144 {"4x4mv", &p4x4mv, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
145 {"no4x4mv", &p4x4mv, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
14468 | 146 {"8x8mv", &p8x8mv, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
147 {"no8x8mv", &p8x8mv, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
14257 | 148 {"b8x8mv", &b8x8mv, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
149 {"nob8x8mv", &b8x8mv, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
15654 | 150 {"i4x4", &i4x4, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
151 {"noi4x4", &i4x4, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
152 {"i8x8", &i8x8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, | |
153 {"noi8x8", &i8x8, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
154 {"8x8dct", &dct8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, | |
155 {"no8x8dct", &dct8, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
17731 | 156 {"direct_pred", &direct_pred, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, |
14759
8c1d40548612
Sync to x264 r134: weighted prediction for B-frames.
lorenm
parents:
14738
diff
changeset
|
157 {"weight_b", &weight_b, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
8c1d40548612
Sync to x264 r134: weighted prediction for B-frames.
lorenm
parents:
14738
diff
changeset
|
158 {"noweight_b", &weight_b, CONF_TYPE_FLAG, 0, 1, 0, NULL}, |
17268 | 159 {"bime", &bidir_me, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
160 {"nobime", &bidir_me, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
14943 | 161 {"chroma_me", &chroma_me, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
162 {"nochroma_me", &chroma_me, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
16712 | 163 {"mixed_refs", &mixed_references, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
164 {"nomixed_refs", &mixed_references, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
14943 | 165 {"chroma_qp_offset", &chroma_qp_offset, CONF_TYPE_INT, CONF_RANGE, -12, 12, NULL}, |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
166 {"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL}, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
167 {"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL}, |
15413 | 168 {"ratetol", &ratetol, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 100.0, NULL}, |
169 {"vbv_maxrate", &vbv_maxrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, | |
170 {"vbv_bufsize", &vbv_bufsize, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, | |
171 {"vbv_init", &vbv_init, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL}, | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
172 {"qp_min", &qp_min, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL}, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
173 {"qp_max", &qp_max, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL}, |
14307
2e35259a1558
change rc_init_buffer to be a fraction of total buffer size.
lorenm
parents:
14257
diff
changeset
|
174 {"qp_step", &qp_step, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL}, |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
175 {"pass", &pass, CONF_TYPE_INT, CONF_RANGE, 1, 3, NULL}, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
176 {"rc_eq", &rc_eq, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
16366
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
177 {"cqm", &cqm, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
178 {"cqm4iy", &cqm4iy, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
179 {"cqm4ic", &cqm4ic, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
180 {"cqm4py", &cqm4py, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
181 {"cqm4pc", &cqm4pc, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
182 {"cqm8iy", &cqm8iy, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
183 {"cqm8py", &cqm8py, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
184 {"qcomp", &qcomp, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL}, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
185 {"qblur", &qblur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL}, |
13965 | 186 {"cplx_blur", &complexity_blur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 999, NULL}, |
15557
40d5e0ccce93
sync to x264 r239 (zoned ratecontrol and UMHex ME)
lorenm
parents:
15413
diff
changeset
|
187 {"zones", &zones, CONF_TYPE_STRING, 0, 0, 0, NULL}, |
17902 | 188 {"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 1, 7, NULL}, |
17025 | 189 {"brdo", &bframe_rdo, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
190 {"nobrdo", &bframe_rdo, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
15557
40d5e0ccce93
sync to x264 r239 (zoned ratecontrol and UMHex ME)
lorenm
parents:
15413
diff
changeset
|
191 {"me", &me_method, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL}, |
15352 | 192 {"me_range", &me_range, CONF_TYPE_INT, CONF_RANGE, 4, 64, NULL}, |
16898 | 193 {"trellis", &trellis, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, |
17402 | 194 {"fast_pskip", &fast_pskip, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
195 {"nofast_pskip", &fast_pskip, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
18207 | 196 {"dct_decimate", &dct_decimate, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
197 {"nodct_decimate", &dct_decimate, CONF_TYPE_FLAG, 0, 0, 0, NULL}, | |
17402 | 198 {"nr", &noise_reduction, CONF_TYPE_INT, CONF_RANGE, 0, 100000, NULL}, |
14738 | 199 {"level_idc", &level_idc, CONF_TYPE_INT, CONF_RANGE, 10, 51, NULL}, |
15590 | 200 {"threads", &threads, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL}, |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
201 {"psnr", &psnr, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
13496
0bdcb3eea569
better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.
iive
parents:
13431
diff
changeset
|
202 {"nopsnr", &psnr, CONF_TYPE_FLAG, 0, 1, 0, NULL}, |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
203 {"log", &log_level, CONF_TYPE_INT, CONF_RANGE, -1, 3, NULL}, |
15966
2170729da726
1/2 l: last patch lacked the option name, so it wasn't activeable
gpoirier
parents:
15964
diff
changeset
|
204 {"turbo", &turbo, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, |
16016 | 205 {"visualize", &visualize, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
206 {"novisualize", &visualize, CONF_TYPE_FLAG, 0, 1, 0, NULL}, | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
207 {NULL, NULL, 0, 0, 0, 0, NULL} |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
208 }; |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
209 |
16366
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
210 static int parse_cqm(const char *str, uint8_t *cqm, int length, |
19104
2ec2301183cd
marks several read-only string parameters which aren't modified inside the called function as const. Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
18207
diff
changeset
|
211 h264_module_t *mod, const char *matrix_name) { |
16366
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
212 int i; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
213 if (!str) return 0; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
214 for (i = 0; i < length; i++) { |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
215 long coef = strtol(str, &str, 0); |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
216 if (coef < 1 || coef > 255 || str[0] != ((i + 1 == length)?0:',')) { |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
217 mp_msg( MSGT_MENCODER, MSGL_ERR, "x264: Invalid entry in cqm%s at position %d.\n", matrix_name, i+1 ); |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
218 return -1; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
219 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
220 cqm[i] = coef; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
221 str = &str[1]; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
222 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
223 mod->param.i_cqm_preset = X264_CQM_CUSTOM; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
224 return 0; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
225 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
226 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17902
diff
changeset
|
227 static int put_image(struct vf_instance_s *vf, mp_image_t *mpi, double pts); |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
228 static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in); |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
229 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
230 static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
231 h264_module_t *mod=(h264_module_t*)vf->priv; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
232 mod->mux->bih->biWidth = width; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
233 mod->mux->bih->biHeight = height; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
234 mod->mux->aspect = (float)d_width/d_height; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
235 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
236 x264_param_default(&mod->param); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
237 mod->param.i_frame_reference = frame_ref; |
14468 | 238 mod->param.i_keyint_max = keyint_max; |
15413 | 239 mod->param.i_keyint_min = keyint_min; |
13584
17cb9c6a99f6
Adds a parameter 'scenecut', to control the threshold for inserting extra I-frames.
iive
parents:
13496
diff
changeset
|
240 mod->param.i_scenecut_threshold = scenecut_threshold; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
241 mod->param.i_bframe = bframe; |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
242 mod->param.b_bframe_adaptive = bframe_adaptive; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
243 mod->param.i_bframe_bias = bframe_bias; |
14916 | 244 mod->param.b_bframe_pyramid = bframe_pyramid; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
245 mod->param.b_deblocking_filter = deblock; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
246 mod->param.i_deblocking_filter_alphac0 = deblockalpha; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
247 mod->param.i_deblocking_filter_beta = deblockbeta; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
248 mod->param.b_cabac = cabac; |
13325 | 249 |
19125 | 250 mod->param.rc.i_rc_method = X264_RC_CQP; |
13325 | 251 mod->param.rc.i_qp_constant = qp_constant; |
19125 | 252 if(rf_constant > 0) |
253 mod->param.rc.i_rc_method = X264_RC_CRF; | |
16846 | 254 mod->param.rc.i_rf_constant = rf_constant; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
255 if(qp_min > qp_constant) |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
256 qp_min = qp_constant; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
257 if(qp_max < qp_constant) |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
258 qp_max = qp_constant; |
13325 | 259 mod->param.rc.i_qp_min = qp_min; |
260 mod->param.rc.i_qp_max = qp_max; | |
261 mod->param.rc.i_qp_step = qp_step; | |
262 mod->param.rc.psz_rc_eq = rc_eq; | |
263 mod->param.rc.f_qcompress = qcomp; | |
264 mod->param.rc.f_qblur = qblur; | |
13965 | 265 mod->param.rc.f_complexity_blur = complexity_blur; |
13431
15efa8ab93e3
add support for subpel quality refinement option in x264.
iive
parents:
13376
diff
changeset
|
266 mod->param.analyse.i_subpel_refine = subq; |
13325 | 267 mod->param.rc.psz_stat_out = passtmpfile; |
268 mod->param.rc.psz_stat_in = passtmpfile; | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
269 if((pass & 2) && bitrate <= 0) |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
270 { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
271 mp_msg(MSGT_MENCODER, MSGL_ERR, |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
272 "2 pass encoding enabled, but no bitrate specified.\n"); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
273 return 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
274 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
275 if(bitrate > 0) { |
15413 | 276 if((vbv_maxrate > 0) != (vbv_bufsize > 0)) { |
277 mp_msg(MSGT_MENCODER, MSGL_ERR, | |
278 "VBV requires both vbv_maxrate and vbv_bufsize.\n"); | |
279 return 0; | |
280 } | |
19125 | 281 mod->param.rc.i_rc_method = X264_RC_ABR; |
13325 | 282 mod->param.rc.i_bitrate = bitrate; |
15413 | 283 mod->param.rc.f_rate_tolerance = ratetol; |
284 mod->param.rc.i_vbv_max_bitrate = vbv_maxrate; | |
285 mod->param.rc.i_vbv_buffer_size = vbv_bufsize; | |
286 mod->param.rc.f_vbv_buffer_init = vbv_init; | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
287 } |
13325 | 288 mod->param.rc.f_ip_factor = ip_factor; |
289 mod->param.rc.f_pb_factor = pb_factor; | |
15557
40d5e0ccce93
sync to x264 r239 (zoned ratecontrol and UMHex ME)
lorenm
parents:
15413
diff
changeset
|
290 mod->param.rc.psz_zones = zones; |
15352 | 291 switch(me_method) { |
292 case 1: mod->param.analyse.i_me_method = X264_ME_DIA; break; | |
293 case 2: mod->param.analyse.i_me_method = X264_ME_HEX; break; | |
15557
40d5e0ccce93
sync to x264 r239 (zoned ratecontrol and UMHex ME)
lorenm
parents:
15413
diff
changeset
|
294 case 3: mod->param.analyse.i_me_method = X264_ME_UMH; break; |
40d5e0ccce93
sync to x264 r239 (zoned ratecontrol and UMHex ME)
lorenm
parents:
15413
diff
changeset
|
295 case 4: mod->param.analyse.i_me_method = X264_ME_ESA; break; |
15352 | 296 } |
15654 | 297 mod->param.analyse.inter = 0; |
298 if(p4x4mv) mod->param.analyse.inter |= X264_ANALYSE_PSUB8x8; | |
299 if(p8x8mv) mod->param.analyse.inter |= X264_ANALYSE_PSUB16x16; | |
300 if(b8x8mv) mod->param.analyse.inter |= X264_ANALYSE_BSUB16x16; | |
301 if(i4x4) mod->param.analyse.inter |= X264_ANALYSE_I4x4; | |
302 if(i8x8) mod->param.analyse.inter |= X264_ANALYSE_I8x8; | |
303 mod->param.analyse.b_transform_8x8 = dct8; | |
14257 | 304 mod->param.analyse.i_direct_mv_pred = direct_pred; |
14759
8c1d40548612
Sync to x264 r134: weighted prediction for B-frames.
lorenm
parents:
14738
diff
changeset
|
305 mod->param.analyse.b_weighted_bipred = weight_b; |
14943 | 306 mod->param.analyse.i_chroma_qp_offset = chroma_qp_offset; |
17268 | 307 mod->param.analyse.b_bidir_me = bidir_me; |
14943 | 308 mod->param.analyse.b_chroma_me = chroma_me; |
16712 | 309 mod->param.analyse.b_mixed_references = mixed_references; |
16898 | 310 mod->param.analyse.i_trellis = trellis; |
17402 | 311 mod->param.analyse.b_fast_pskip = fast_pskip; |
18207 | 312 mod->param.analyse.b_dct_decimate = dct_decimate; |
17402 | 313 mod->param.analyse.i_noise_reduction = noise_reduction; |
17025 | 314 mod->param.analyse.b_bframe_rdo = bframe_rdo; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
315 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
316 mod->param.i_width = width; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
317 mod->param.i_height = height; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
318 mod->param.i_fps_num = mod->mux->h.dwRate; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
319 mod->param.i_fps_den = mod->mux->h.dwScale; |
14738 | 320 mod->param.i_level_idc = level_idc; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
321 mod->param.analyse.b_psnr = psnr; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
322 mod->param.i_log_level = log_level; |
16016 | 323 mod->param.b_visualize = visualize; |
14023 | 324 mod->param.vui.i_sar_width = d_width*height; |
325 mod->param.vui.i_sar_height = d_height*width; | |
15590 | 326 mod->param.i_threads = threads; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
327 |
16366
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
328 if(cqm != NULL) |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
329 { |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
330 if( !strcmp(cqm, "flat") ) |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
331 mod->param.i_cqm_preset = X264_CQM_FLAT; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
332 else if( !strcmp(cqm, "jvt") ) |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
333 mod->param.i_cqm_preset = X264_CQM_JVT; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
334 else |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
335 { |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
336 FILE *cqm_test; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
337 cqm_test = fopen( cqm, "rb" ); |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
338 if( cqm_test ) |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
339 { |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
340 mod->param.i_cqm_preset = X264_CQM_CUSTOM; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
341 mod->param.psz_cqm_file = cqm; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
342 fclose( cqm_test ); |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
343 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
344 else |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
345 { |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
346 mp_msg( MSGT_MENCODER, MSGL_ERR, "x264: CQM file failed to open.\n" ); |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
347 return 0; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
348 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
349 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
350 } |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
351 |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
352 if( (parse_cqm(cqm4iy, mod->param.cqm_4iy, 16, mod, "4iy") < 0) || |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
353 (parse_cqm(cqm4ic, mod->param.cqm_4ic, 16, mod, "4ic") < 0) || |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
354 (parse_cqm(cqm4py, mod->param.cqm_4py, 16, mod, "4py") < 0) || |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
355 (parse_cqm(cqm4pc, mod->param.cqm_4pc, 16, mod, "4pc") < 0) || |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
356 (parse_cqm(cqm8iy, mod->param.cqm_8iy, 64, mod, "8iy") < 0) || |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
357 (parse_cqm(cqm8py, mod->param.cqm_8py, 64, mod, "8py") < 0) ) |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
358 return 0; |
e054a3c93a26
custom quantization matrix for x264, original patch by Robert Swain < robert POUM swain AH gmail POUM com>
gpoirier
parents:
16016
diff
changeset
|
359 |
15964
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
360 switch(pass) { |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
361 case 0: |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
362 mod->param.rc.b_stat_write = 0; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
363 mod->param.rc.b_stat_read = 0; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
364 break; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
365 case 1: |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
366 /* Adjust or disable some flags to gain speed in the first pass */ |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
367 if(turbo == 1) |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
368 { |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
369 mod->param.i_frame_reference = ( frame_ref + 1 ) >> 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
370 mod->param.analyse.i_subpel_refine = max( min( 3, subq - 1 ), 1 ); |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
371 mod->param.analyse.inter &= ( ~X264_ANALYSE_PSUB8x8 ); |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
372 mod->param.analyse.inter &= ( ~X264_ANALYSE_BSUB16x16 ); |
16898 | 373 mod->param.analyse.i_trellis = 0; |
15964
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
374 } |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
375 else if(turbo == 2) |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
376 { |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
377 mod->param.i_frame_reference = 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
378 mod->param.analyse.i_subpel_refine = 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
379 mod->param.analyse.i_me_method = X264_ME_DIA; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
380 mod->param.analyse.inter = 0; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
381 mod->param.analyse.b_transform_8x8 = 0; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
382 mod->param.analyse.b_weighted_bipred = 0; |
16898 | 383 mod->param.analyse.i_trellis = 0; |
15964
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
384 } |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
385 mod->param.rc.b_stat_write = 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
386 mod->param.rc.b_stat_read = 0; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
387 break; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
388 case 2: |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
389 mod->param.rc.b_stat_write = 0; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
390 mod->param.rc.b_stat_read = 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
391 break; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
392 case 3: |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
393 mod->param.rc.b_stat_write = 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
394 mod->param.rc.b_stat_read = 1; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
395 break; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
396 } |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
397 |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
398 if(me_method >= 3) |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
399 mod->param.analyse.i_me_range = me_range; |
d244178a3105
x264 fast first pass, patch by Robert Swain < robert POUM swain AH gmail POUM com >
gpoirier
parents:
15744
diff
changeset
|
400 |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
401 switch(outfmt) { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
402 case IMGFMT_I420: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
403 mod->param.i_csp = X264_CSP_I420; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
404 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
405 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
406 case IMGFMT_YV12: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
407 mod->param.i_csp = X264_CSP_YV12; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
408 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
409 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
410 case IMGFMT_422P: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
411 mod->param.i_csp = X264_CSP_I422; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
412 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
413 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
414 case IMGFMT_444P: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
415 mod->param.i_csp = X264_CSP_I444; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
416 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
417 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
418 case IMGFMT_YVYU: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
419 mod->param.i_csp = X264_CSP_YUYV; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
420 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
421 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
422 case IMGFMT_RGB: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
423 mod->param.i_csp = X264_CSP_RGB; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
424 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
425 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
426 case IMGFMT_BGR: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
427 mod->param.i_csp = X264_CSP_BGR; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
428 mod->mux->bih->biSizeImage = width * height * 3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
429 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
430 case IMGFMT_BGR32: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
431 mod->param.i_csp = X264_CSP_BGRA; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
432 mod->mux->bih->biSizeImage = width * height * 4; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
433 break; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
434 default: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
435 mp_msg(MSGT_MENCODER, MSGL_ERR, "Wrong colorspace.\n"); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
436 return 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
437 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
438 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
439 mod->x264 = x264_encoder_open(&mod->param); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
440 if(!mod->x264) { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
441 mp_msg(MSGT_MENCODER, MSGL_ERR, "x264_encoder_open failed.\n"); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
442 return 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
443 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
444 |
17659 | 445 if (mod->param.i_bframe > 1 && mod->param.b_bframe_pyramid) |
446 mod->mux->decoder_delay = 2; | |
447 else | |
448 mod->mux->decoder_delay = mod->param.i_bframe ? 1 : 0; | |
449 | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
450 return 1; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
451 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
452 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
453 static int control(struct vf_instance_s* vf, int request, void *data) |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
454 { |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
455 switch(request){ |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
456 case VFCTRL_FLUSH_FRAMES: |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
457 if(bframe) |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
458 while(encode_frame(vf, NULL) > 0); |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
459 return CONTROL_TRUE; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
460 default: |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
461 return CONTROL_UNKNOWN; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
462 } |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
463 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
464 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
465 static int query_format(struct vf_instance_s* vf, unsigned int fmt) |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
466 { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
467 switch(fmt) { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
468 case IMGFMT_I420: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
469 return (VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
470 case IMGFMT_YV12: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
471 case IMGFMT_422P: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
472 case IMGFMT_444P: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
473 case IMGFMT_YVYU: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
474 case IMGFMT_RGB: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
475 case IMGFMT_BGR: |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
476 case IMGFMT_BGR32: |
14943 | 477 /* These colorspaces are supported, but they'll just have |
478 * to be converted to I420 internally */ | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
479 return 0; /* VFCAP_CSP_SUPPORTED */ |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
480 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
481 return 0; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
482 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
483 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17902
diff
changeset
|
484 static int put_image(struct vf_instance_s *vf, mp_image_t *mpi, double pts) |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
485 { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
486 h264_module_t *mod=(h264_module_t*)vf->priv; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
487 int i; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
488 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
489 memset(&mod->pic, 0, sizeof(x264_picture_t)); |
14846 | 490 mod->pic.img.i_csp=mod->param.i_csp; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
491 mod->pic.img.i_plane=3; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
492 for(i=0; i<4; i++) { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
493 mod->pic.img.plane[i] = mpi->planes[i]; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
494 mod->pic.img.i_stride[i] = mpi->stride[i]; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
495 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
496 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
497 mod->pic.i_type = X264_TYPE_AUTO; |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
498 |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
499 return encode_frame(vf, &mod->pic) >= 0; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
500 } |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
501 |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
502 static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in) |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
503 { |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
504 h264_module_t *mod=(h264_module_t*)vf->priv; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
505 x264_picture_t pic_out; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
506 x264_nal_t *nal; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
507 int i_nal; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
508 int i_size = 0; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
509 int i; |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
510 |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
511 if(x264_encoder_encode(mod->x264, &nal, &i_nal, pic_in, &pic_out) < 0) { |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
512 mp_msg(MSGT_MENCODER, MSGL_ERR, "x264_encoder_encode failed\n"); |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
513 return -1; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
514 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
515 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
516 for(i=0; i < i_nal; i++) { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
517 int i_data = mod->mux->buffer_size - i_size; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
518 i_size += x264_nal_encode(mod->mux->buffer + i_size, &i_data, 1, &nal[i]); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
519 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
520 if(i_size>0) { |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
521 int keyframe = (pic_out.i_type == X264_TYPE_IDR) || |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
522 (pic_out.i_type == X264_TYPE_I |
14468 | 523 && frame_ref == 1 && !bframe); |
17487
fa17424b4c7b
change muxer_write_chunk() so that pts/dts _could_ be passed from encoder to muxer
michael
parents:
17402
diff
changeset
|
524 muxer_write_chunk(mod->mux, i_size, keyframe?0x10:0, MP_NOPTS_VALUE, MP_NOPTS_VALUE); |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
525 } |
17659 | 526 else |
527 ++mod->mux->encoder_delay; | |
14784
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
528 |
53d306774ce2
sync to x264 r137: adaptive B-frame decision, flush delayed frames.
lorenm
parents:
14759
diff
changeset
|
529 return i_size; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
530 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
531 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
532 static void uninit(struct vf_instance_s *vf) |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
533 { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
534 h264_module_t *mod=(h264_module_t*)vf->priv; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
535 x264_encoder_close(mod->x264); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
536 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
537 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
538 static int vf_open(vf_instance_t *vf, char *args) { |
13334 | 539 h264_module_t *mod; |
540 | |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
541 vf->config = config; |
14878 | 542 vf->default_caps = VFCAP_CONSTANT; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
543 vf->control = control; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
544 vf->query_format = query_format; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
545 vf->put_image = put_image; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
546 vf->uninit = uninit; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
547 vf->priv = malloc(sizeof(h264_module_t)); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
548 |
13334 | 549 mod=(h264_module_t*)vf->priv; |
13166
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
550 mod->mux = (muxer_stream_t*)args; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
551 mod->mux->bih = malloc(sizeof(BITMAPINFOHEADER)); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
552 memset(mod->mux->bih, 0, sizeof(BITMAPINFOHEADER)); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
553 mod->mux->bih->biSize = sizeof(BITMAPINFOHEADER); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
554 mod->mux->bih->biPlanes = 1; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
555 mod->mux->bih->biBitCount = 24; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
556 mod->mux->bih->biCompression = mmioFOURCC('h', '2', '6', '4'); |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
557 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
558 return 1; |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
559 } |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
560 |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
561 vf_info_t ve_info_x264 = { |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
562 "H.264 encoder", |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
563 "x264", |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
564 "Bernhard Rosenkraenzer <bero@arklinux.org>", |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
565 "(C) 2004 LINUX4MEDIA GmbH; (C) 2004 Ark Linux", |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
566 vf_open |
d198f255bee9
x264 encoder support. Original patch send by Bernhard Rosenkraenzer <bero at arklinux dot org>, modifications by Loren Merritt <lorenm at u.washington dot edu>, Jeff Clagg <snacky at ikaruga.co dot uk> and me
iive
parents:
diff
changeset
|
567 }; |