~siretart/x264/trunk

« back to all changes in this revision

Viewing changes to input/y4m.c

  • Committer: Henrik Gramner
  • Author(s): Emanuele Ruffaldi
  • Date: 2018-08-06 21:24:12 UTC
  • Revision ID: git-v1:698c5a32e63a3ed6b976ed196abe479efd78530b
4:0:0 (monochrome) encoding support

Virtually zero increase in compression efficiency compared to 4:2:0 with empty
chroma planes. Performance is better though, especially with fast settings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
static int parse_csp_and_depth( char *csp_name, int *bit_depth )
50
50
{
51
 
    int csp    = X264_CSP_MAX;
 
51
    int csp = X264_CSP_MAX;
52
52
 
53
53
    /* Set colorspace from known variants */
54
 
    if( !strncmp( "420", csp_name, 3 ) )
 
54
    if( !strncmp( "mono", csp_name, 4 ) )
 
55
        csp = X264_CSP_I400;
 
56
    else if( !strncmp( "420", csp_name, 3 ) )
55
57
        csp = X264_CSP_I420;
56
58
    else if( !strncmp( "422", csp_name, 3 ) )
57
59
        csp = X264_CSP_I422;
59
61
        csp = X264_CSP_I444;
60
62
 
61
63
    /* Set high bit depth from known extensions */
62
 
    if( sscanf( csp_name, "%*d%*[pP]%d", bit_depth ) != 1 )
 
64
    if( sscanf( csp_name, "mono%d", bit_depth ) != 1 &&
 
65
        sscanf( csp_name, "%*d%*[pP]%d", bit_depth ) != 1 )
63
66
        *bit_depth = 8;
64
67
 
65
68
    return csp;