Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -26,6 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include "bit_depth_template.c" | 26 | #include "bit_depth_template.c" |
| 27 | #include "hevcdsp.h" | 27 | #include "hevcdsp.h" |
| 28 | #include "h26x/h2656_sao_template.c" | 28 | #include "h26x/h2656_sao_template.c" |
| 29 | #include "h26x/h2656_inter_template.c" | ||
| 29 | 30 | ||
| 30 | static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int width, int height, | 31 | static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int width, int height, |
| 31 | GetBitContext *gb, int pcm_bit_depth) | 32 | GetBitContext *gb, int pcm_bit_depth) |
| @@ -299,37 +300,51 @@ IDCT_DC(32) · 267 unmodified lines | |||
| 299 | //////////////////////////////////////////////////////////////////////////////// | 300 | //////////////////////////////////////////////////////////////////////////////// |
| 300 | // | 301 | // |
| 301 | //////////////////////////////////////////////////////////////////////////////// | 302 | //////////////////////////////////////////////////////////////////////////////// |
| 302 | static void FUNC(put_hevc_pel_pixels)(int16_t *dst, | 303 | #define ff_hevc_pel_filters ff_hevc_qpel_filters |
| 303 | const uint8_t *_src, ptrdiff_t _srcstride, | 304 | #define DECL_HV_FILTER(f) \ |
| 304 | int height, intptr_t mx, intptr_t my, int width) | 305 | const uint8_t *hf = ff_hevc_ ## f ## _filters[mx - 1]; \ |
| 305 | { | 306 | const uint8_t *vf = ff_hevc_ ## f ## _filters[my - 1]; |
| 306 | int x, y; | 307 | |
| 307 | const pixel *src = (const pixel *)_src; | 308 | #define FW_PUT(p, f, t) \ |
| 308 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | 309 | static void FUNC(put_hevc_## f)(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, \ |
| 309 | 310 | intptr_t mx, intptr_t my, int width) \ | |
| 310 | for (y = 0; y < height; y++) { | 311 | { \ |
| 311 | for (x = 0; x < width; x++) | 312 | DECL_HV_FILTER(p) \ |
| 312 | dst[x] = src[x] << (14 - BIT_DEPTH); | 313 | FUNC(put_ ## t)(dst, src, srcstride, height, hf, vf, width); \ |
| 313 | src += srcstride; | 314 | } |
| 314 | dst += MAX_PB_SIZE; | 315 | |
| 315 | } | 316 | #define FW_PUT_UNI(p, f, t) \ |
| 316 | } | 317 | static void FUNC(put_hevc_ ## f)(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ |
| 317 | 318 | ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width) \ | |
| 318 | static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | 319 | { \ |
| 319 | int height, intptr_t mx, intptr_t my, int width) | 320 | DECL_HV_FILTER(p) \ |
| 320 | { | 321 | FUNC(put_ ## t)(dst, dststride, src, srcstride, height, hf, vf, width); \ |
| 321 | int y; | 322 | } |
| 322 | const pixel *src = (const pixel *)_src; | 323 | |
| 323 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | 324 | #define FW_PUT_UNI_W(p, f, t) \ |
| 324 | pixel *dst = (pixel *)_dst; | 325 | static void FUNC(put_hevc_ ## f)(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ |
| 325 | ptrdiff_t dststride = _dststride / sizeof(pixel); | 326 | ptrdiff_t srcstride,int height, int denom, int wx, int ox, \ |
| 326 | 327 | intptr_t mx, intptr_t my, int width) \ | |
| 327 | for (y = 0; y < height; y++) { | 328 | { \ |
| 328 | memcpy(dst, src, width * sizeof(pixel)); | 329 | DECL_HV_FILTER(p) \ |
| 329 | src += srcstride; | 330 | FUNC(put_ ## t)(dst, dststride, src, srcstride, height, denom, wx, ox, hf, vf, width); \ |
| 330 | dst += dststride; | 331 | } |
| 331 | } | 332 | |
| 332 | } | 333 | #define FW_PUT_FUNCS(f, t, dir) \ |
| 334 | FW_PUT(f, f ## _ ## dir, t ## _ ## dir) \ | ||
| 335 | FW_PUT_UNI(f, f ## _uni_ ## dir, uni_ ## t ## _ ## dir) \ | ||
| 336 | FW_PUT_UNI_W(f, f ## _uni_w_ ## dir, uni_## t ## _w_ ## dir) | ||
| 337 | |||
| 338 | FW_PUT(pel, pel_pixels, pixels) | ||
| 339 | FW_PUT_UNI(pel, pel_uni_pixels, uni_pixels) | ||
| 340 | FW_PUT_UNI_W(pel, pel_uni_w_pixels, uni_w_pixels) | ||
| 341 | |||
| 342 | FW_PUT_FUNCS(qpel, luma, h ) | ||
| 343 | FW_PUT_FUNCS(qpel, luma, v ) | ||
| 344 | FW_PUT_FUNCS(qpel, luma, hv ) | ||
| 345 | FW_PUT_FUNCS(epel, chroma, h ) | ||
| 346 | FW_PUT_FUNCS(epel, chroma, v ) | ||
| 347 | FW_PUT_FUNCS(epel, chroma, hv ) | ||
| 333 | 348 | ||
| 334 | static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | 349 | static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, |
| 335 | const int16_t *src2, | 350 | const int16_t *src2, |
| @@ -357,30 +372,6 @@ static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, co · 21 unmodified lines | |||
| 357 | } | 372 | } |
| 358 | } | 373 | } |
| 359 | 374 | ||
| 360 | static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 361 | int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) | ||
| 362 | { | ||
| 363 | int x, y; | ||
| 364 | const pixel *src = (const pixel *)_src; | ||
| 365 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 366 | pixel *dst = (pixel *)_dst; | ||
| 367 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 368 | int shift = denom + 14 - BIT_DEPTH; | ||
| 369 | #if BIT_DEPTH < 14 | ||
| 370 | int offset = 1 << (shift - 1); | ||
| 371 | #else | ||
| 372 | int offset = 0; | ||
| 373 | #endif | ||
| 374 | |||
| 375 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 376 | for (y = 0; y < height; y++) { | ||
| 377 | for (x = 0; x < width; x++) | ||
| 378 | dst[x] = av_clip_pixel((((src[x] << (14 - BIT_DEPTH)) * wx + offset) >> shift) + ox); | ||
| 379 | src += srcstride; | ||
| 380 | dst += dststride; | ||
| 381 | } | ||
| 382 | } | ||
| 383 | |||
| 384 | static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | 375 | static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, |
| 385 | const int16_t *src2, | 376 | const int16_t *src2, |
| 386 | int height, int denom, int wx0, int wx1, | 377 | int height, int denom, int wx0, int wx1, |
| @@ -420,96 +411,6 @@ static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, · 33 unmodified lines | |||
| 420 | filter[6] * src[x + 3 * stride] + \ | 411 | filter[6] * src[x + 3 * stride] + \ |
| 421 | filter[7] * src[x + 4 * stride]) | 412 | filter[7] * src[x + 4 * stride]) |
| 422 | 413 | ||
| 423 | static void FUNC(put_hevc_qpel_h)(int16_t *dst, | ||
| 424 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 425 | int height, intptr_t mx, intptr_t my, int width) | ||
| 426 | { | ||
| 427 | int x, y; | ||
| 428 | const pixel *src = (const pixel*)_src; | ||
| 429 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 430 | const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; | ||
| 431 | for (y = 0; y < height; y++) { | ||
| 432 | for (x = 0; x < width; x++) | ||
| 433 | dst[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 434 | src += srcstride; | ||
| 435 | dst += MAX_PB_SIZE; | ||
| 436 | } | ||
| 437 | } | ||
| 438 | |||
| 439 | static void FUNC(put_hevc_qpel_v)(int16_t *dst, | ||
| 440 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 441 | int height, intptr_t mx, intptr_t my, int width) | ||
| 442 | { | ||
| 443 | int x, y; | ||
| 444 | const pixel *src = (const pixel*)_src; | ||
| 445 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 446 | const int8_t *filter = ff_hevc_qpel_filters[my - 1]; | ||
| 447 | for (y = 0; y < height; y++) { | ||
| 448 | for (x = 0; x < width; x++) | ||
| 449 | dst[x] = QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8); | ||
| 450 | src += srcstride; | ||
| 451 | dst += MAX_PB_SIZE; | ||
| 452 | } | ||
| 453 | } | ||
| 454 | |||
| 455 | static void FUNC(put_hevc_qpel_hv)(int16_t *dst, | ||
| 456 | const uint8_t *_src, | ||
| 457 | ptrdiff_t _srcstride, | ||
| 458 | int height, intptr_t mx, | ||
| 459 | intptr_t my, int width) | ||
| 460 | { | ||
| 461 | int x, y; | ||
| 462 | const int8_t *filter; | ||
| 463 | const pixel *src = (const pixel*)_src; | ||
| 464 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 465 | int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; | ||
| 466 | int16_t *tmp = tmp_array; | ||
| 467 | |||
| 468 | src -= QPEL_EXTRA_BEFORE * srcstride; | ||
| 469 | filter = ff_hevc_qpel_filters[mx - 1]; | ||
| 470 | for (y = 0; y < height + QPEL_EXTRA; y++) { | ||
| 471 | for (x = 0; x < width; x++) | ||
| 472 | tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 473 | src += srcstride; | ||
| 474 | tmp += MAX_PB_SIZE; | ||
| 475 | } | ||
| 476 | |||
| 477 | tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; | ||
| 478 | filter = ff_hevc_qpel_filters[my - 1]; | ||
| 479 | for (y = 0; y < height; y++) { | ||
| 480 | for (x = 0; x < width; x++) | ||
| 481 | dst[x] = QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6; | ||
| 482 | tmp += MAX_PB_SIZE; | ||
| 483 | dst += MAX_PB_SIZE; | ||
| 484 | } | ||
| 485 | } | ||
| 486 | |||
| 487 | static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, | ||
| 488 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 489 | int height, intptr_t mx, intptr_t my, int width) | ||
| 490 | { | ||
| 491 | int x, y; | ||
| 492 | const pixel *src = (const pixel*)_src; | ||
| 493 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 494 | pixel *dst = (pixel *)_dst; | ||
| 495 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 496 | const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; | ||
| 497 | int shift = 14 - BIT_DEPTH; | ||
| 498 | |||
| 499 | #if BIT_DEPTH < 14 | ||
| 500 | int offset = 1 << (shift - 1); | ||
| 501 | #else | ||
| 502 | int offset = 0; | ||
| 503 | #endif | ||
| 504 | |||
| 505 | for (y = 0; y < height; y++) { | ||
| 506 | for (x = 0; x < width; x++) | ||
| 507 | dst[x] = av_clip_pixel(((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + offset) >> shift); | ||
| 508 | src += srcstride; | ||
| 509 | dst += dststride; | ||
| 510 | } | ||
| 511 | } | ||
| 512 | |||
| 513 | static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | 414 | static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, |
| 514 | const int16_t *src2, | 415 | const int16_t *src2, |
| 515 | int height, intptr_t mx, intptr_t my, int width) | 416 | int height, intptr_t mx, intptr_t my, int width) |
| @@ -538,33 +439,6 @@ static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const · 22 unmodified lines | |||
| 538 | } | 439 | } |
| 539 | } | 440 | } |
| 540 | 441 | ||
| 541 | static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, | ||
| 542 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 543 | int height, intptr_t mx, intptr_t my, int width) | ||
| 544 | { | ||
| 545 | int x, y; | ||
| 546 | const pixel *src = (const pixel*)_src; | ||
| 547 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 548 | pixel *dst = (pixel *)_dst; | ||
| 549 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 550 | const int8_t *filter = ff_hevc_qpel_filters[my - 1]; | ||
| 551 | int shift = 14 - BIT_DEPTH; | ||
| 552 | |||
| 553 | #if BIT_DEPTH < 14 | ||
| 554 | int offset = 1 << (shift - 1); | ||
| 555 | #else | ||
| 556 | int offset = 0; | ||
| 557 | #endif | ||
| 558 | |||
| 559 | for (y = 0; y < height; y++) { | ||
| 560 | for (x = 0; x < width; x++) | ||
| 561 | dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + offset) >> shift); | ||
| 562 | src += srcstride; | ||
| 563 | dst += dststride; | ||
| 564 | } | ||
| 565 | } | ||
| 566 | |||
| 567 | |||
| 568 | static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, | 442 | static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, |
| 569 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 443 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 570 | int height, intptr_t mx, intptr_t my, int width) | 444 | int height, intptr_t mx, intptr_t my, int width) |
| @@ -593,46 +467,6 @@ static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, · 22 unmodified lines | |||
| 593 | } | 467 | } |
| 594 | } | 468 | } |
| 595 | 469 | ||
| 596 | static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, | ||
| 597 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 598 | int height, intptr_t mx, intptr_t my, int width) | ||
| 599 | { | ||
| 600 | int x, y; | ||
| 601 | const int8_t *filter; | ||
| 602 | const pixel *src = (const pixel*)_src; | ||
| 603 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 604 | pixel *dst = (pixel *)_dst; | ||
| 605 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 606 | int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; | ||
| 607 | int16_t *tmp = tmp_array; | ||
| 608 | int shift = 14 - BIT_DEPTH; | ||
| 609 | |||
| 610 | #if BIT_DEPTH < 14 | ||
| 611 | int offset = 1 << (shift - 1); | ||
| 612 | #else | ||
| 613 | int offset = 0; | ||
| 614 | #endif | ||
| 615 | |||
| 616 | src -= QPEL_EXTRA_BEFORE * srcstride; | ||
| 617 | filter = ff_hevc_qpel_filters[mx - 1]; | ||
| 618 | for (y = 0; y < height + QPEL_EXTRA; y++) { | ||
| 619 | for (x = 0; x < width; x++) | ||
| 620 | tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 621 | src += srcstride; | ||
| 622 | tmp += MAX_PB_SIZE; | ||
| 623 | } | ||
| 624 | |||
| 625 | tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; | ||
| 626 | filter = ff_hevc_qpel_filters[my - 1]; | ||
| 627 | |||
| 628 | for (y = 0; y < height; y++) { | ||
| 629 | for (x = 0; x < width; x++) | ||
| 630 | dst[x] = av_clip_pixel(((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + offset) >> shift); | ||
| 631 | tmp += MAX_PB_SIZE; | ||
| 632 | dst += dststride; | ||
| 633 | } | ||
| 634 | } | ||
| 635 | |||
| 636 | static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, | 470 | static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, |
| 637 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 471 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 638 | int height, intptr_t mx, intptr_t my, int width) | 472 | int height, intptr_t mx, intptr_t my, int width) |
| @@ -673,33 +507,6 @@ static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, · 34 unmodified lines | |||
| 673 | } | 507 | } |
| 674 | } | 508 | } |
| 675 | 509 | ||
| 676 | static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, | ||
| 677 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 678 | int height, int denom, int wx, int ox, | ||
| 679 | intptr_t mx, intptr_t my, int width) | ||
| 680 | { | ||
| 681 | int x, y; | ||
| 682 | const pixel *src = (const pixel*)_src; | ||
| 683 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 684 | pixel *dst = (pixel *)_dst; | ||
| 685 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 686 | const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; | ||
| 687 | int shift = denom + 14 - BIT_DEPTH; | ||
| 688 | #if BIT_DEPTH < 14 | ||
| 689 | int offset = 1 << (shift - 1); | ||
| 690 | #else | ||
| 691 | int offset = 0; | ||
| 692 | #endif | ||
| 693 | |||
| 694 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 695 | for (y = 0; y < height; y++) { | ||
| 696 | for (x = 0; x < width; x++) | ||
| 697 | dst[x] = av_clip_pixel((((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); | ||
| 698 | src += srcstride; | ||
| 699 | dst += dststride; | ||
| 700 | } | ||
| 701 | } | ||
| 702 | |||
| 703 | static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, | 510 | static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, |
| 704 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 511 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 705 | int height, int denom, int wx0, int wx1, | 512 | int height, int denom, int wx0, int wx1, |
| @@ -728,33 +535,6 @@ static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, · 22 unmodified lines | |||
| 728 | } | 535 | } |
| 729 | } | 536 | } |
| 730 | 537 | ||
| 731 | static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, | ||
| 732 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 733 | int height, int denom, int wx, int ox, | ||
| 734 | intptr_t mx, intptr_t my, int width) | ||
| 735 | { | ||
| 736 | int x, y; | ||
| 737 | const pixel *src = (const pixel*)_src; | ||
| 738 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 739 | pixel *dst = (pixel *)_dst; | ||
| 740 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 741 | const int8_t *filter = ff_hevc_qpel_filters[my - 1]; | ||
| 742 | int shift = denom + 14 - BIT_DEPTH; | ||
| 743 | #if BIT_DEPTH < 14 | ||
| 744 | int offset = 1 << (shift - 1); | ||
| 745 | #else | ||
| 746 | int offset = 0; | ||
| 747 | #endif | ||
| 748 | |||
| 749 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 750 | for (y = 0; y < height; y++) { | ||
| 751 | for (x = 0; x < width; x++) | ||
| 752 | dst[x] = av_clip_pixel((((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); | ||
| 753 | src += srcstride; | ||
| 754 | dst += dststride; | ||
| 755 | } | ||
| 756 | } | ||
| 757 | |||
| 758 | static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, | 538 | static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, |
| 759 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 539 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 760 | int height, int denom, int wx0, int wx1, | 540 | int height, int denom, int wx0, int wx1, |
| @@ -783,47 +563,6 @@ static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, · 22 unmodified lines | |||
| 783 | } | 563 | } |
| 784 | } | 564 | } |
| 785 | 565 | ||
| 786 | static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, | ||
| 787 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 788 | int height, int denom, int wx, int ox, | ||
| 789 | intptr_t mx, intptr_t my, int width) | ||
| 790 | { | ||
| 791 | int x, y; | ||
| 792 | const int8_t *filter; | ||
| 793 | const pixel *src = (const pixel*)_src; | ||
| 794 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 795 | pixel *dst = (pixel *)_dst; | ||
| 796 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 797 | int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; | ||
| 798 | int16_t *tmp = tmp_array; | ||
| 799 | int shift = denom + 14 - BIT_DEPTH; | ||
| 800 | #if BIT_DEPTH < 14 | ||
| 801 | int offset = 1 << (shift - 1); | ||
| 802 | #else | ||
| 803 | int offset = 0; | ||
| 804 | #endif | ||
| 805 | |||
| 806 | src -= QPEL_EXTRA_BEFORE * srcstride; | ||
| 807 | filter = ff_hevc_qpel_filters[mx - 1]; | ||
| 808 | for (y = 0; y < height + QPEL_EXTRA; y++) { | ||
| 809 | for (x = 0; x < width; x++) | ||
| 810 | tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 811 | src += srcstride; | ||
| 812 | tmp += MAX_PB_SIZE; | ||
| 813 | } | ||
| 814 | |||
| 815 | tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; | ||
| 816 | filter = ff_hevc_qpel_filters[my - 1]; | ||
| 817 | |||
| 818 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 819 | for (y = 0; y < height; y++) { | ||
| 820 | for (x = 0; x < width; x++) | ||
| 821 | dst[x] = av_clip_pixel((((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx + offset) >> shift) + ox); | ||
| 822 | tmp += MAX_PB_SIZE; | ||
| 823 | dst += dststride; | ||
| 824 | } | ||
| 825 | } | ||
| 826 | |||
| 827 | static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, | 566 | static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, |
| 828 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 567 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 829 | int height, int denom, int wx0, int wx1, | 568 | int height, int denom, int wx0, int wx1, |
| @@ -873,94 +612,6 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, · 43 unmodified lines | |||
| 873 | filter[2] * src[x + stride] + \ | 612 | filter[2] * src[x + stride] + \ |
| 874 | filter[3] * src[x + 2 * stride]) | 613 | filter[3] * src[x + 2 * stride]) |
| 875 | 614 | ||
| 876 | static void FUNC(put_hevc_epel_h)(int16_t *dst, | ||
| 877 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 878 | int height, intptr_t mx, intptr_t my, int width) | ||
| 879 | { | ||
| 880 | int x, y; | ||
| 881 | const pixel *src = (const pixel *)_src; | ||
| 882 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 883 | const int8_t *filter = ff_hevc_epel_filters[mx - 1]; | ||
| 884 | for (y = 0; y < height; y++) { | ||
| 885 | for (x = 0; x < width; x++) | ||
| 886 | dst[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 887 | src += srcstride; | ||
| 888 | dst += MAX_PB_SIZE; | ||
| 889 | } | ||
| 890 | } | ||
| 891 | |||
| 892 | static void FUNC(put_hevc_epel_v)(int16_t *dst, | ||
| 893 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 894 | int height, intptr_t mx, intptr_t my, int width) | ||
| 895 | { | ||
| 896 | int x, y; | ||
| 897 | const pixel *src = (const pixel *)_src; | ||
| 898 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 899 | const int8_t *filter = ff_hevc_epel_filters[my - 1]; | ||
| 900 | |||
| 901 | for (y = 0; y < height; y++) { | ||
| 902 | for (x = 0; x < width; x++) | ||
| 903 | dst[x] = EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8); | ||
| 904 | src += srcstride; | ||
| 905 | dst += MAX_PB_SIZE; | ||
| 906 | } | ||
| 907 | } | ||
| 908 | |||
| 909 | static void FUNC(put_hevc_epel_hv)(int16_t *dst, | ||
| 910 | const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 911 | int height, intptr_t mx, intptr_t my, int width) | ||
| 912 | { | ||
| 913 | int x, y; | ||
| 914 | const pixel *src = (const pixel *)_src; | ||
| 915 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 916 | const int8_t *filter = ff_hevc_epel_filters[mx - 1]; | ||
| 917 | int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; | ||
| 918 | int16_t *tmp = tmp_array; | ||
| 919 | |||
| 920 | src -= EPEL_EXTRA_BEFORE * srcstride; | ||
| 921 | |||
| 922 | for (y = 0; y < height + EPEL_EXTRA; y++) { | ||
| 923 | for (x = 0; x < width; x++) | ||
| 924 | tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 925 | src += srcstride; | ||
| 926 | tmp += MAX_PB_SIZE; | ||
| 927 | } | ||
| 928 | |||
| 929 | tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; | ||
| 930 | filter = ff_hevc_epel_filters[my - 1]; | ||
| 931 | |||
| 932 | for (y = 0; y < height; y++) { | ||
| 933 | for (x = 0; x < width; x++) | ||
| 934 | dst[x] = EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6; | ||
| 935 | tmp += MAX_PB_SIZE; | ||
| 936 | dst += MAX_PB_SIZE; | ||
| 937 | } | ||
| 938 | } | ||
| 939 | |||
| 940 | static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 941 | int height, intptr_t mx, intptr_t my, int width) | ||
| 942 | { | ||
| 943 | int x, y; | ||
| 944 | const pixel *src = (const pixel *)_src; | ||
| 945 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 946 | pixel *dst = (pixel *)_dst; | ||
| 947 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 948 | const int8_t *filter = ff_hevc_epel_filters[mx - 1]; | ||
| 949 | int shift = 14 - BIT_DEPTH; | ||
| 950 | #if BIT_DEPTH < 14 | ||
| 951 | int offset = 1 << (shift - 1); | ||
| 952 | #else | ||
| 953 | int offset = 0; | ||
| 954 | #endif | ||
| 955 | |||
| 956 | for (y = 0; y < height; y++) { | ||
| 957 | for (x = 0; x < width; x++) | ||
| 958 | dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + offset) >> shift); | ||
| 959 | src += srcstride; | ||
| 960 | dst += dststride; | ||
| 961 | } | ||
| 962 | } | ||
| 963 | |||
| 964 | static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, | 615 | static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, |
| 965 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 616 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 966 | int height, intptr_t mx, intptr_t my, int width) | 617 | int height, intptr_t mx, intptr_t my, int width) |
| @@ -988,30 +639,6 @@ static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, · 21 unmodified lines | |||
| 988 | } | 639 | } |
| 989 | } | 640 | } |
| 990 | 641 | ||
| 991 | static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 992 | int height, intptr_t mx, intptr_t my, int width) | ||
| 993 | { | ||
| 994 | int x, y; | ||
| 995 | const pixel *src = (const pixel *)_src; | ||
| 996 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 997 | pixel *dst = (pixel *)_dst; | ||
| 998 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 999 | const int8_t *filter = ff_hevc_epel_filters[my - 1]; | ||
| 1000 | int shift = 14 - BIT_DEPTH; | ||
| 1001 | #if BIT_DEPTH < 14 | ||
| 1002 | int offset = 1 << (shift - 1); | ||
| 1003 | #else | ||
| 1004 | int offset = 0; | ||
| 1005 | #endif | ||
| 1006 | |||
| 1007 | for (y = 0; y < height; y++) { | ||
| 1008 | for (x = 0; x < width; x++) | ||
| 1009 | dst[x] = av_clip_pixel(((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + offset) >> shift); | ||
| 1010 | src += srcstride; | ||
| 1011 | dst += dststride; | ||
| 1012 | } | ||
| 1013 | } | ||
| 1014 | |||
| 1015 | static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, | 642 | static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, |
| 1016 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 643 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 1017 | int height, intptr_t mx, intptr_t my, int width) | 644 | int height, intptr_t mx, intptr_t my, int width) |
| @@ -1038,44 +665,6 @@ static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, · 20 unmodified lines | |||
| 1038 | } | 665 | } |
| 1039 | } | 666 | } |
| 1040 | 667 | ||
| 1041 | static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 1042 | int height, intptr_t mx, intptr_t my, int width) | ||
| 1043 | { | ||
| 1044 | int x, y; | ||
| 1045 | const pixel *src = (const pixel *)_src; | ||
| 1046 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 1047 | pixel *dst = (pixel *)_dst; | ||
| 1048 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 1049 | const int8_t *filter = ff_hevc_epel_filters[mx - 1]; | ||
| 1050 | int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; | ||
| 1051 | int16_t *tmp = tmp_array; | ||
| 1052 | int shift = 14 - BIT_DEPTH; | ||
| 1053 | #if BIT_DEPTH < 14 | ||
| 1054 | int offset = 1 << (shift - 1); | ||
| 1055 | #else | ||
| 1056 | int offset = 0; | ||
| 1057 | #endif | ||
| 1058 | |||
| 1059 | src -= EPEL_EXTRA_BEFORE * srcstride; | ||
| 1060 | |||
| 1061 | for (y = 0; y < height + EPEL_EXTRA; y++) { | ||
| 1062 | for (x = 0; x < width; x++) | ||
| 1063 | tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 1064 | src += srcstride; | ||
| 1065 | tmp += MAX_PB_SIZE; | ||
| 1066 | } | ||
| 1067 | |||
| 1068 | tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; | ||
| 1069 | filter = ff_hevc_epel_filters[my - 1]; | ||
| 1070 | |||
| 1071 | for (y = 0; y < height; y++) { | ||
| 1072 | for (x = 0; x < width; x++) | ||
| 1073 | dst[x] = av_clip_pixel(((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + offset) >> shift); | ||
| 1074 | tmp += MAX_PB_SIZE; | ||
| 1075 | dst += dststride; | ||
| 1076 | } | ||
| 1077 | } | ||
| 1078 | |||
| 1079 | static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, | 668 | static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, |
| 1080 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 669 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 1081 | int height, intptr_t mx, intptr_t my, int width) | 670 | int height, intptr_t mx, intptr_t my, int width) |
| @@ -1116,32 +705,6 @@ static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, · 34 unmodified lines | |||
| 1116 | } | 705 | } |
| 1117 | } | 706 | } |
| 1118 | 707 | ||
| 1119 | static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 1120 | int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) | ||
| 1121 | { | ||
| 1122 | int x, y; | ||
| 1123 | const pixel *src = (const pixel *)_src; | ||
| 1124 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 1125 | pixel *dst = (pixel *)_dst; | ||
| 1126 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 1127 | const int8_t *filter = ff_hevc_epel_filters[mx - 1]; | ||
| 1128 | int shift = denom + 14 - BIT_DEPTH; | ||
| 1129 | #if BIT_DEPTH < 14 | ||
| 1130 | int offset = 1 << (shift - 1); | ||
| 1131 | #else | ||
| 1132 | int offset = 0; | ||
| 1133 | #endif | ||
| 1134 | |||
| 1135 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 1136 | for (y = 0; y < height; y++) { | ||
| 1137 | for (x = 0; x < width; x++) { | ||
| 1138 | dst[x] = av_clip_pixel((((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); | ||
| 1139 | } | ||
| 1140 | dst += dststride; | ||
| 1141 | src += srcstride; | ||
| 1142 | } | ||
| 1143 | } | ||
| 1144 | |||
| 1145 | static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, | 708 | static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, |
| 1146 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 709 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 1147 | int height, int denom, int wx0, int wx1, | 710 | int height, int denom, int wx0, int wx1, |
| @@ -1168,32 +731,6 @@ static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, · 20 unmodified lines | |||
| 1168 | } | 731 | } |
| 1169 | } | 732 | } |
| 1170 | 733 | ||
| 1171 | static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 1172 | int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) | ||
| 1173 | { | ||
| 1174 | int x, y; | ||
| 1175 | const pixel *src = (const pixel *)_src; | ||
| 1176 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 1177 | pixel *dst = (pixel *)_dst; | ||
| 1178 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 1179 | const int8_t *filter = ff_hevc_epel_filters[my - 1]; | ||
| 1180 | int shift = denom + 14 - BIT_DEPTH; | ||
| 1181 | #if BIT_DEPTH < 14 | ||
| 1182 | int offset = 1 << (shift - 1); | ||
| 1183 | #else | ||
| 1184 | int offset = 0; | ||
| 1185 | #endif | ||
| 1186 | |||
| 1187 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 1188 | for (y = 0; y < height; y++) { | ||
| 1189 | for (x = 0; x < width; x++) { | ||
| 1190 | dst[x] = av_clip_pixel((((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); | ||
| 1191 | } | ||
| 1192 | dst += dststride; | ||
| 1193 | src += srcstride; | ||
| 1194 | } | ||
| 1195 | } | ||
| 1196 | |||
| 1197 | static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, | 734 | static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, |
| 1198 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 735 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 1199 | int height, int denom, int wx0, int wx1, | 736 | int height, int denom, int wx0, int wx1, |
| @@ -1220,45 +757,6 @@ static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, · 20 unmodified lines | |||
| 1220 | } | 757 | } |
| 1221 | } | 758 | } |
| 1222 | 759 | ||
| 1223 | static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, | ||
| 1224 | int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) | ||
| 1225 | { | ||
| 1226 | int x, y; | ||
| 1227 | const pixel *src = (const pixel *)_src; | ||
| 1228 | ptrdiff_t srcstride = _srcstride / sizeof(pixel); | ||
| 1229 | pixel *dst = (pixel *)_dst; | ||
| 1230 | ptrdiff_t dststride = _dststride / sizeof(pixel); | ||
| 1231 | const int8_t *filter = ff_hevc_epel_filters[mx - 1]; | ||
| 1232 | int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; | ||
| 1233 | int16_t *tmp = tmp_array; | ||
| 1234 | int shift = denom + 14 - BIT_DEPTH; | ||
| 1235 | #if BIT_DEPTH < 14 | ||
| 1236 | int offset = 1 << (shift - 1); | ||
| 1237 | #else | ||
| 1238 | int offset = 0; | ||
| 1239 | #endif | ||
| 1240 | |||
| 1241 | src -= EPEL_EXTRA_BEFORE * srcstride; | ||
| 1242 | |||
| 1243 | for (y = 0; y < height + EPEL_EXTRA; y++) { | ||
| 1244 | for (x = 0; x < width; x++) | ||
| 1245 | tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); | ||
| 1246 | src += srcstride; | ||
| 1247 | tmp += MAX_PB_SIZE; | ||
| 1248 | } | ||
| 1249 | |||
| 1250 | tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; | ||
| 1251 | filter = ff_hevc_epel_filters[my - 1]; | ||
| 1252 | |||
| 1253 | ox = ox * (1 << (BIT_DEPTH - 8)); | ||
| 1254 | for (y = 0; y < height; y++) { | ||
| 1255 | for (x = 0; x < width; x++) | ||
| 1256 | dst[x] = av_clip_pixel((((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx + offset) >> shift) + ox); | ||
| 1257 | tmp += MAX_PB_SIZE; | ||
| 1258 | dst += dststride; | ||
| 1259 | } | ||
| 1260 | } | ||
| 1261 | |||
| 1262 | static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, | 760 | static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, |
| 1263 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, | 761 | const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, |
| 1264 | int height, int denom, int wx0, int wx1, | 762 | int height, int denom, int wx0, int wx1, |