📄 scale_horz_h.h
字号:
/* ======================================================================== */
/* */
/* TEXAS INSTRUMENTS, INC. */
/* */
/* NAME */
/* scale_horz */
/* */
/* */
/* USAGE */
/* This routine is C-callable and can be called as: */
/* */
/* void scale_horz */
/* ( */
/* unsigned short *in_data, // Ptr to unscaled lines // */
/* unsigned int in_len, // Pixels/line unscaled // */
/* short *out_data, // Ptr to scaled data lines // */
/* unsigned int out_len, // Pixels/line of scaled data // */
/* short *hh, // Ptr to filter taps, */
/* interleaved odd/even */
/* outputs // */
/* unsigned int l_hh, // Length of scaling filters // */
/* unsigned int n_hh, // Number of scaling filters // */
/* short *patch // Ptr to decrement pattern // */
/* ); */
/* */
/* DESCRIPTION */
/* */
/* This code can scale up or down 1 line of data, in the */
/* ratio out_len : in_len. e.g 1 to 3, 4:3, 5:6. The */
/* filters are designed outside of the loop using a */
/* general purpose resizing algorithm. */
/* */
/* patch0 = patch + 2; */
/* filter_count = n_hh; */
/* ka = 0; */
/* */
/* line0_x = plane_x; */
/* line0_y = plane_y; */
/* ptr_hh = hh; */
/* jump = (int) patch[0]; ka = jump >> 1; */
/* jump = (int) patch[1]; kb = jump >> 1; */
/* */
/* for ( i = 0; i < n_y; i += 2) */
/* { */
/* y0 = 1 << 5; */
/* y1 = 1 << 5; */
/* for ( j = 0; j < l_hh; j+=4) */
/* { */
/* // even outputs // */
/* for (k=0; k < 4; k++) */
/* { */
/* h0 = *ptr_hh++; */
/* x0 = *(line0_x+ ka + k); */
/* y0 += ( x0 * h0 ); */
/* } */
/* jump = (int) (*patch0++); */
/* ka = ka + (jump>>1); */
/* // odd outputs // */
/* for (k=0; k < 4; k++) */
/* { */
/* h1 = *ptr_hh++; */
/* x1 = *(line0_x + kb + k); */
/* y1 += ( x1 * h1 ); */
/* } */
/* jump = (int) (*patch0++); */
/* kb = kb + (jump>>1); */
/* } */
/* *line0_y++ = (short) (y0 >> 6) ; */
/* *line0_y++ = (short) (y1 >> 6) ; */
/* */
/* filter_count -= 2; */
/* if (!filter_count) */
/* { */
/* patch0 = patch + 2; */
/* ptr_hh = hh; */
/* filter_count = n_hh; */
/* } */
/* } */
/* */
/* ASSUMPTIONS */
/* One line of data is produced per function call. */
/* */
/* The line must be aligned on a double word boundary and be a */
/* multiples of 8 bytes. */
/* */
/* Filters are multiples of 4 taps, maximum number of filters is 256. */
/* */
/* The computations for each output are interleaved, thus the filters */
/* are interleaved on a 4 short interval. */
/* */
/* Little ENDIAN Configuration is used and the input and output data */
/* is 16 bit unsinged and signed shorts respectively. The filters */
/* are also 16 bit signed shorts in 12 bit precision. */
/* */
/* The n_hh filters are all of the same length and are */
/* strung together in a single linear array. */
/* */
/* Interrupts are masked by the function for most of its duration. */
/* */
/* MEMORY NOTE */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -