Skip to content

Commit

Permalink
remove colorspace conversion support, because it has no business in a…
Browse files Browse the repository at this point in the history
…ny codec

git-svn-id: svn://svn.videolan.org/x264/trunk@733 df754926-b1dd-0310-bc7b-ec298dee348c
  • Loading branch information
Loren Merritt committed Jan 27, 2008
1 parent c1940b9 commit efeb097
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 493 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include config.mak

SRCS = common/mc.c common/predict.c common/pixel.c common/macroblock.c \
common/frame.c common/dct.c common/cpu.c common/cabac.c \
common/common.c common/mdate.c common/csp.c common/set.c \
common/common.c common/mdate.c common/set.c \
common/quant.c \
encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
encoder/set.c encoder/macroblock.c encoder/cabac.c \
Expand Down
64 changes: 7 additions & 57 deletions common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,63 +589,13 @@ void x264_picture_alloc( x264_picture_t *pic, int i_csp, int i_width, int i_heig
pic->i_type = X264_TYPE_AUTO;
pic->i_qpplus1 = 0;
pic->img.i_csp = i_csp;
switch( i_csp & X264_CSP_MASK )
{
case X264_CSP_I420:
case X264_CSP_YV12:
pic->img.i_plane = 3;
pic->img.plane[0] = x264_malloc( 3 * i_width * i_height / 2 );
pic->img.plane[1] = pic->img.plane[0] + i_width * i_height;
pic->img.plane[2] = pic->img.plane[1] + i_width * i_height / 4;
pic->img.i_stride[0] = i_width;
pic->img.i_stride[1] = i_width / 2;
pic->img.i_stride[2] = i_width / 2;
break;

case X264_CSP_I422:
pic->img.i_plane = 3;
pic->img.plane[0] = x264_malloc( 2 * i_width * i_height );
pic->img.plane[1] = pic->img.plane[0] + i_width * i_height;
pic->img.plane[2] = pic->img.plane[1] + i_width * i_height / 2;
pic->img.i_stride[0] = i_width;
pic->img.i_stride[1] = i_width / 2;
pic->img.i_stride[2] = i_width / 2;
break;

case X264_CSP_I444:
pic->img.i_plane = 3;
pic->img.plane[0] = x264_malloc( 3 * i_width * i_height );
pic->img.plane[1] = pic->img.plane[0] + i_width * i_height;
pic->img.plane[2] = pic->img.plane[1] + i_width * i_height;
pic->img.i_stride[0] = i_width;
pic->img.i_stride[1] = i_width;
pic->img.i_stride[2] = i_width;
break;

case X264_CSP_YUYV:
pic->img.i_plane = 1;
pic->img.plane[0] = x264_malloc( 2 * i_width * i_height );
pic->img.i_stride[0] = 2 * i_width;
break;

case X264_CSP_RGB:
case X264_CSP_BGR:
pic->img.i_plane = 1;
pic->img.plane[0] = x264_malloc( 3 * i_width * i_height );
pic->img.i_stride[0] = 3 * i_width;
break;

case X264_CSP_BGRA:
pic->img.i_plane = 1;
pic->img.plane[0] = x264_malloc( 4 * i_width * i_height );
pic->img.i_stride[0] = 4 * i_width;
break;

default:
fprintf( stderr, "invalid CSP\n" );
pic->img.i_plane = 0;
break;
}
pic->img.i_plane = 3;
pic->img.plane[0] = x264_malloc( 3 * i_width * i_height / 2 );
pic->img.plane[1] = pic->img.plane[0] + i_width * i_height;
pic->img.plane[2] = pic->img.plane[1] + i_width * i_height / 4;
pic->img.i_stride[0] = i_width;
pic->img.i_stride[1] = i_width / 2;
pic->img.i_stride[2] = i_width / 2;
}

/****************************************************************************
Expand Down
2 changes: 0 additions & 2 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
#include "frame.h"
#include "dct.h"
#include "cabac.h"
#include "csp.h"
#include "quant.h"

/****************************************************************************
Expand Down Expand Up @@ -559,7 +558,6 @@ struct x264_t
x264_mc_functions_t mc;
x264_dct_function_t dctf;
x264_zigzag_function_t zigzagf;
x264_csp_function_t csp;
x264_quant_function_t quantf;
x264_deblock_function_t loopf;

Expand Down
Loading

0 comments on commit efeb097

Please sign in to comment.