const-a.asm 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ;*****************************************************************************
  2. ;* const-a.asm: x86 global constants
  3. ;*****************************************************************************
  4. ;* Copyright (C) 2010-2018 x264 project
  5. ;*
  6. ;* Authors: Loren Merritt <lorenm@u.washington.edu>
  7. ;* Fiona Glaser <fiona@x264.com>
  8. ;*
  9. ;* This program is free software; you can redistribute it and/or modify
  10. ;* it under the terms of the GNU General Public License as published by
  11. ;* the Free Software Foundation; either version 2 of the License, or
  12. ;* (at your option) any later version.
  13. ;*
  14. ;* This program is distributed in the hope that it will be useful,
  15. ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;* GNU General Public License for more details.
  18. ;*
  19. ;* You should have received a copy of the GNU General Public License
  20. ;* along with this program; if not, write to the Free Software
  21. ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
  22. ;*
  23. ;* This program is also available under a commercial proprietary license.
  24. ;* For more information, contact us at licensing@x264.com.
  25. ;*****************************************************************************
  26. %include "x86inc.asm"
  27. SECTION_RODATA 32
  28. const pb_1, times 32 db 1
  29. const hsub_mul, times 16 db 1, -1
  30. const pw_1, times 16 dw 1
  31. const pw_16, times 16 dw 16
  32. const pw_32, times 16 dw 32
  33. const pw_512, times 16 dw 512
  34. const pw_00ff, times 16 dw 0x00ff
  35. const pw_pixel_max,times 16 dw ((1 << BIT_DEPTH)-1)
  36. const pw_0to15, dw 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
  37. const pd_1, times 8 dd 1
  38. const pd_0123, dd 0,1,2,3
  39. const pd_4567, dd 4,5,6,7
  40. const deinterleave_shufd, dd 0,4,1,5,2,6,3,7
  41. const pb_unpackbd1, times 2 db 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3
  42. const pb_unpackbd2, times 2 db 4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7
  43. const pb_01, times 8 db 0,1
  44. const pb_0, times 16 db 0
  45. const pb_a1, times 16 db 0xa1
  46. const pb_3, times 16 db 3
  47. const pb_shuf8x8c, db 0,0,0,0,2,2,2,2,4,4,4,4,6,6,6,6
  48. const pw_2, times 8 dw 2
  49. const pw_m2, times 8 dw -2
  50. const pw_4, times 8 dw 4
  51. const pw_8, times 8 dw 8
  52. const pw_64, times 8 dw 64
  53. const pw_256, times 8 dw 256
  54. const pw_32_0, times 4 dw 32,
  55. times 4 dw 0
  56. const pw_8000, times 8 dw 0x8000
  57. const pw_3fff, times 8 dw 0x3fff
  58. const pw_ppppmmmm, dw 1,1,1,1,-1,-1,-1,-1
  59. const pw_ppmmppmm, dw 1,1,-1,-1,1,1,-1,-1
  60. const pw_pmpmpmpm, dw 1,-1,1,-1,1,-1,1,-1
  61. const pw_pmmpzzzz, dw 1,-1,-1,1,0,0,0,0
  62. const pd_8, times 4 dd 8
  63. const pd_32, times 4 dd 32
  64. const pd_1024, times 4 dd 1024
  65. const pd_ffff, times 4 dd 0xffff
  66. const pw_ff00, times 8 dw 0xff00
  67. const popcnt_table
  68. %assign x 0
  69. %rep 256
  70. ; population count
  71. db ((x>>0)&1)+((x>>1)&1)+((x>>2)&1)+((x>>3)&1)+((x>>4)&1)+((x>>5)&1)+((x>>6)&1)+((x>>7)&1)
  72. %assign x x+1
  73. %endrep
  74. const sw_64, dd 64