Skip to content

Commit

Permalink
hevc: store the 'tc' chroma deblocking values as int16_t
Browse files Browse the repository at this point in the history
  • Loading branch information
smarter committed Jan 10, 2014
1 parent 7c6acc6 commit 5ffd7fc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
5 changes: 3 additions & 2 deletions libavcodec/hevc_filter.c
Expand Up @@ -45,7 +45,7 @@ static const uint8_t betatable[52] = {
38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64 // QP 38...51
};

static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
static int16_t chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
{
static const int qp_c[] = {
29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37
Expand Down Expand Up @@ -335,7 +335,8 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
{
uint8_t *src;
int x, y, x_end, y_end, chroma;
int c_tc[2], beta[2], tc[2];
int beta[2], tc[2];
int16_t c_tc[2];
uint8_t no_p[2] = { 0 };
uint8_t no_q[2] = { 0 };

Expand Down
8 changes: 4 additions & 4 deletions libavcodec/hevcdsp.h
Expand Up @@ -85,20 +85,20 @@ typedef struct HEVCDSPContext {
int *beta, int *tc,
uint8_t *no_p, uint8_t *no_q);
void (*hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
int *tc, uint8_t *no_p, uint8_t *no_q);
int16_t *tc, uint8_t *no_p, uint8_t *no_q);
void (*hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
int *tc, uint8_t *no_p, uint8_t *no_q);
int16_t *tc, uint8_t *no_p, uint8_t *no_q);
void (*hevc_h_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
int *beta, int *tc,
uint8_t *no_p, uint8_t *no_q);
void (*hevc_v_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
int *beta, int *tc,
uint8_t *no_p, uint8_t *no_q);
void (*hevc_h_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
int *tc, uint8_t *no_p,
int16_t *tc, uint8_t *no_p,
uint8_t *no_q);
void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
int *tc, uint8_t *no_p,
int16_t *tc, uint8_t *no_p,
uint8_t *no_q);
} HEVCDSPContext;

Expand Down
6 changes: 3 additions & 3 deletions libavcodec/hevcdsp_template.c
Expand Up @@ -1258,7 +1258,7 @@ static void FUNC(hevc_loop_filter_luma)(uint8_t *_pix,
}

static void FUNC(hevc_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _xstride,
ptrdiff_t _ystride, int *_tc,
ptrdiff_t _ystride, int16_t *_tc,
uint8_t *_no_p, uint8_t *_no_q)
{
int d, j, no_p, no_q;
Expand Down Expand Up @@ -1292,14 +1292,14 @@ static void FUNC(hevc_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _xstride,
}

static void FUNC(hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
int *tc, uint8_t *no_p,
int16_t *tc, uint8_t *no_p,
uint8_t *no_q)
{
FUNC(hevc_loop_filter_chroma)(pix, stride, sizeof(pixel), tc, no_p, no_q);
}

static void FUNC(hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
int *tc, uint8_t *no_p,
int16_t *tc, uint8_t *no_p,
uint8_t *no_q)
{
FUNC(hevc_loop_filter_chroma)(pix, sizeof(pixel), stride, tc, no_p, no_q);
Expand Down
7 changes: 2 additions & 5 deletions libavcodec/x86/hevc_deblock.asm
Expand Up @@ -256,12 +256,9 @@ ff_hevc_chroma_deblock_body:
paddw m5, m4

; tc calculations
movd m6, [r2] ; tc0
add r2, 4
movd m6, [r2]
punpcklwd m6, m6
movd m7, [r2] ; tc1
punpcklwd m7, m7
shufps m6, m7, 0 ; tc0, tc1
punpckldq m6, m6 ; tc0, tc1
movdqa m4, m6
pcmpeqw m7, m7 ; set all bits to 1
pxor m4, m7 ; flip all bits of first reg
Expand Down

0 comments on commit 5ffd7fc

Please sign in to comment.