Skip to content
Snippets Groups Projects

Fix #534: Bug in user-defined scaling list

Merged Kiyofumi Abe requested to merge AbeKiyo/VVCSoftware_VTM:SCALING_LISTS_BUGFIX into master

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • This change sets isAllDefault to false, if there is one list, that is not equal. So this seems correct.

    But later we have:

    return !isAllDefault;

    While the comment says:

    "returns true if use default quantization matrix in all size"

    So either the return or the comment is wrong.

    Btw, I also think checkDefaultScalingList is not a good name, because as user of the function I would nor know, what the bool return value is supposed to be. Also the function does not check the default list, it is comparing some input to the default list. isDefaultScalingList or isEqualToDefaultScalingList may be better.

  • Kiyofumi Abe added 1 commit

    added 1 commit

    Compare with previous version

  • Author Contributor

    Thank you for the comments. I have updated the function name and comment in the source code accordingly.

  • mentioned in commit 6a160c04

    • Jamaika @Jamaika commented on commit 35e46e07

      I understand that these messages are correct

      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
       2001 |       if( !( !::memcmp(getScalingListAddress(sizeId, listId), getScalingListDefaultAddress(sizeId, listId), sizeof(int)*std::min(MAX_MATRIX_COEF_NUM, (int)g_scalingListSize[sizeId])) // check value of matrix
            |               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
      Slice.cpp:2001:23: warning: 'int __builtin_memcmp_eq(const void*, const void*, long long unsigned int)' reading 256 bytes from a region of size 64 [-Wstringop-overflow=]
    • Author Contributor

      Sorry, I will check it.

    • Author Contributor

      This warning has not occurred in my linux and windows environments. I think this warning depends on the gcc version and it is independent of this bugfix. Unfortunately, I have no way to reproduce this warning.

    • Maybe

            if ( ::memcmp(getScalingListAddress(sizeId, listId), getScalingListDefaultAddress(sizeId, listId), sizeof(int)*std::min(MAX_MATRIX_COEF_NUM, (int)g_scalingListSize[sizeId])) // check value of matrix
               && !( (sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == 16) ) ) // check DC value
    • Author Contributor

      Thank you for informing me. I will try it.

    • Author Contributor

      I have confirmed that your suggestion solves this error without any issues. I have created new merge request as following; !974 (merged)

    • Please register or sign in to reply
  • Kiyofumi Abe mentioned in merge request !974 (merged)

    mentioned in merge request !974 (merged)

  • Frank Bossen mentioned in commit 5fe4d7f5

    mentioned in commit 5fe4d7f5

Please register or sign in to reply
Loading