WO2015007207A1 - Target image block decoding and encoding method, and decoder and encoder - Google Patents

Target image block decoding and encoding method, and decoder and encoder Download PDF

Info

Publication number
WO2015007207A1
WO2015007207A1 PCT/CN2014/082255 CN2014082255W WO2015007207A1 WO 2015007207 A1 WO2015007207 A1 WO 2015007207A1 CN 2014082255 W CN2014082255 W CN 2014082255W WO 2015007207 A1 WO2015007207 A1 WO 2015007207A1
Authority
WO
WIPO (PCT)
Prior art keywords
elements
target
matching
prediction
palette
Prior art date
Application number
PCT/CN2014/082255
Other languages
French (fr)
Chinese (zh)
Inventor
朱文静
张红
區子廉
杨海涛
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015007207A1 publication Critical patent/WO2015007207A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission

Definitions

  • the present invention relates to the field of video coding and decoding, and in particular, to a decoding method and a decoder of a target image block, and an encoding method and an encoder of the target image block.
  • the palette encoding mode uses the characteristics of the sparse distribution of the screen image signal, and selects several signals to represent the image information of a certain area, so that the tone can be compared according to the principle of minimum distortion.
  • the swatch encoding mode and other optional encoding modes are used to select a better encoding mode for the image block.
  • the invention provides a decoding method and an encoding method of a target image block, and a decoder and encoding
  • the aim of the present invention is to solve the problem of low compression efficiency of video images in the existing palette coding mode.
  • a decoding method of a target image block including: acquiring prediction information of a target palette from a code stream of a received target image block, wherein the target image block is encoded by a palette a mode image block, the target palette is a set of target elements, each target element in the set of target elements being representative based on a sample point value of a signal component of the target image block a value, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, The second type of element does not need to be determined according to the matching element in the palette template; according to the prediction information, a set of matching elements in the palette template is determined, wherein the palette template is matched by a collection of elements and/or a collection of non-matching elements, the set of matching elements comprising at least one matching element, the matching element being used Matching an element of the first type of element, an absolute value
  • the prediction information includes an element prediction identifier, and determining, according to the prediction information, a set of matching elements in the palette template, including: A set of matching elements in the palette template is determined based on the element prediction identifier.
  • the determining, according to the element prediction identifier, the set of matching elements in the palette template includes:
  • the element prediction identifier is a predicted identifier of the palette template, and a set of matching elements in the palette template is determined according to the predicted identifier of the palette template, wherein the prediction identifier of the palette template is used And indicating a set of the matching elements in the palette template and a set of the non-matching elements.
  • the prediction information when the set of matching elements is non-empty, the prediction information further includes first predicted location information, The first predicted location information is used to indicate a location of the first type of elements corresponding to the set of matching elements in the set of the target elements; when the number of matching elements in the set of matching elements is less than the target a number of the target elements in the set of the elements, the determining the set of the target elements according to the prediction information and the set of the matching elements, including: according to the prediction identifier of the palette template, the first Predicting location information and the set of matching elements, determining a value of the at least one first class element in the set of target elements and a location thereof; obtaining the target element from a code stream of the target image block The value of the at least one second type element in the collection.
  • the prediction information when the set of the matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location The information is used to indicate a position of the first type element corresponding to the set of the matching elements in the set of the target elements; when the number of matching elements in the set of the matching elements is equal to the target in the set of the target element Determining the set of the target elements according to the prediction information and the set of matching elements, including: determining, according to the element, the first predicted location information, and the matching element And determining a value of the at least one first class element in the set of the target elements and a location thereof.
  • the determining the set of the target elements according to the prediction information and the set of the matching elements including: sorting in ascending or descending order according to a numerical value, according to the element And predicting the identifier and the set of matching elements, determining a value of all of the target elements in the set of the target elements and a location thereof.
  • the prediction information further includes first predicted difference information, wherein the first predicted difference information is used And indicating a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the according to the prediction information and the And determining, by the set of the matching elements, the set of the target elements, including: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the determining, according to the element prediction identifier, a set of matching elements in the palette template including:
  • the element prediction identifier is a predicted identifier of the element in the palette template, and the matching element in the palette template is determined according to the predicted identifier of the element in the palette template, and all the matched matches are determined.
  • the elements constitute a set of the matching elements, wherein the predicted identification of the elements in the palette template is used to indicate that the elements in the palette template are matching elements or non-matching elements.
  • the prediction information when the set of the matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of matching elements is less than the target element in the set of the target element Determining, according to the prediction information and the set of matching elements, determining the set of the target elements, including: according to the prediction identifier of the element in the palette template, the second predicted location information, and Determining a set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; obtaining the at least the set of the target elements from a code stream of the target image block The value of a second type of element.
  • the prediction information when the set of matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of the matching element is equal to the target element in the set of the target element And determining, according to the prediction information and the set of matching elements, the set of the target elements, including: according to the predicted identifier of the element in the palette template, the second predicted location information, and the A set of matching elements, determining a value and a location of the at least one first type of element in the set of target elements.
  • the determining the set of the target elements according to the prediction information and the set of the matching elements including: according to a numerical value Sorting in ascending or descending order, determining a value of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
  • the prediction information further includes second predicted difference information, wherein the second predicted difference information Determining a difference between the first type of elements in the target palette and matching elements in the palette template; determining, according to the prediction information and the set of matching elements, And the set of the target elements includes: adjusting, according to the second predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes first index information, where the first index information is used to indicate the set of matching elements a corresponding position of all matching elements in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is the a predicted identifier of the target palette, and the predicted identifier of the target palette indicates the at least one first type element in the target palette, and the first index is determined in the palette template All matching elements of the corresponding locations indicated by the information constitute a set of matching elements in the palette template.
  • the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements Determining, according to the prediction information and the set of matching elements, the set of the target elements, including: a prediction identifier according to the target palette, the first index information, and a set of the matching elements Determining a value and a location of the at least one first class element in the set of target elements; obtaining the at least one second class element in the set of the target elements from a code stream of the target image block The value.
  • the fourteenth embodiment of the first aspect when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, Determining, according to the prediction information and the set of matching elements, the set of the target elements, including: according to the prediction identifier of the target palette, the first index information, and the set of matching elements, Determining a value and a location of the at least one first class element in the set of target elements.
  • the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements Determining, according to the prediction information and the set of matching elements, determining the set of the target elements, including: arranging in ascending or descending order according to a numerical value, and predicting an identifier according to the element and a set of the matching elements And determining a value of all target elements in the set of the target elements and their positions.
  • the prediction information further includes first prediction difference information, wherein the first prediction The difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and its matching elements in the palette template; Determining the at least one first class element in the set of the target elements, the prediction identifier of the color palette, the first index information, and the set of matching elements, including: according to the first predicted difference information And adjusting a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the a corresponding position in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is an element in the target palette a prediction identifier, and the prediction identifier of the target element in the target palette is used to indicate that the target element is a first type element, and sequentially determine a corresponding location in the palette template indicated by the second index information Matching elements, all of the determined matching elements constitute a set of the matching elements in the palette template.
  • the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements And determining, according to the prediction information and the set of matching elements, the set of the target elements, including: determining, according to the prediction identifier of the element in the target palette, the second index information, and the matching element And a set of values of the at least one first type of elements in the set of target elements; obtaining the at least one of the set of target elements from a code stream of the target image block The value of the class element.
  • the nineteenth implementation of the first aspect when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, Determining, according to the prediction information and the set of matching elements, the set of the target elements, including: according to a prediction identifier of an element in the target palette, the second index information, and the matching element And determining a value and a location of the at least one first class element in the set of the target elements.
  • the twentieth embodiment of the first aspect when the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements Determining, according to the prediction information and the set of matching elements, determining the set of the target elements, including: arranging in ascending or descending order according to a numerical value, and predicting an identifier according to the element and a set of the matching elements And determining a value of all target elements in the set of the target elements and their positions.
  • the prediction information further includes second predicted difference information, wherein the second The prediction difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template; the prediction identifier according to the elements in the target palette And determining, by the second index information and the set of matching elements, the at least one first type element in the set of the target elements, including: adjusting, determining the target according to the second predicted difference information The value of the at least one first class element in the set of elements.
  • the prediction information further includes first index information, wherein the first index information is used to indicate a set of the matching elements a corresponding position of all matching elements in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is Determining, in the palette template, the number of the matching elements in the set of matching elements, and the number is greater than or equal to 1, determining all the corresponding positions in the palette template indicated by the first index information Matching elements constitute a set of matching elements in the palette template, wherein the number of matching elements in the set of matching elements in the palette template is used to indicate that the target palette is capable of being Find the number of matching elements in the palette template.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first class element in the set of target elements; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, Determining the set of the target elements according to the prediction information and the set of matching elements, including: according to the number of the matching elements in the set of matching elements in the palette template, the first Predicting location information and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; obtaining a set of the target elements from a code stream of the target image block The value of the at least one second type element in the medium.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first type of elements in the set of target elements; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, Determining the set of the target elements according to the prediction information and the set of matching elements, including: according to the number of the matching elements in the set of matching elements in the palette template, the first prediction The location information and the set of matching elements determine a value and a location of the at least one first class element in the set of target elements.
  • the twenty-fifth implementation manner of the first aspect when the number of matching elements in the set of matching elements is less than or equal to the target in the set of the target elements Determining the set of the target elements according to the prediction information and the set of matching elements, including: sorting in ascending or descending order according to a numerical value, and predicting the identifier and the matching element according to the element a collection that determines the values of all of the target elements in the set of target elements and their locations.
  • the prediction information further includes first prediction difference information, where The first predicted difference value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; Determining the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements
  • the first type of element includes: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the a corresponding position in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is in the palette template a number of the matching elements in the set of matching elements, and the number is greater than or equal to 1, and determining, in sequence, matching elements of corresponding positions indicated by the second index information in the palette template, determined All of the matching elements constitute a set of matching elements in the palette template, wherein the number of the matching elements in the set of matching elements in the palette template is used to indicate the target palette The number of matching elements can be found in the palette template.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of the matching element is less than the number of the target elements in the set of the target element, the basis Determining, by the set of the prediction information, the set of the matching elements, determining the set of the target elements, including: according to the number of the matching elements in the set of the matching elements in the palette template, the second predicted location information And determining, by the set of the matching elements, a value and a location of the at least one first class element in the set of the target elements; acquiring a location in the set of the target elements from a code stream of the target image block The value of at least one second type of element.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target element, according to the Predicting information and a set of matching elements to determine the target
  • the set of the target elements includes: determining, according to the number of the matched elements in the set of matching elements in the palette template, the second predicted position information, and the set of the matching elements, determining the target element The value and location of the at least one first class element in the collection.
  • the thirtieth embodiment of the first aspect when the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements Determining the set of the target elements according to the prediction information and the set of matching elements, including: sorting in ascending or descending order according to a numerical value, and predicting the identifier and the matching element according to the element A set that determines the values of all of the target elements in the set of target elements and their locations.
  • the prediction information further includes second predicted difference information, wherein The second predicted difference information is used to indicate a difference between the first type of elements in the target palette and matching elements in the palette template; the according to the palette template Determining the number of the matching elements in the set of matching elements, the second predicted location information, and the set of matching elements, determining the at least one first class element in the set of the target elements, including: according to the The second predicted difference information adjusts a value of the at least one first type element in the set of the target elements.
  • the second predicted difference information adjusts a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes prediction indication information, where the prediction indication information is used to indicate the target adjustment Whether or not one of the first type elements exists in the swatch can be determined according to the prediction information and the set of matching elements.
  • the updating the palette template comprises: utilizing the at least one of the target palettes a second type of element, updating a set of the non-matching elements in the palette template; and using the target element in the target palette, respectively updating a counter value corresponding to the element in the palette template.
  • a coding method of a target image block comprising: constructing a target color palette, wherein the target color image is a set of target elements, each target element in the set of the target element is based on a representative value determined by a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first The class element is a target element that needs to be determined according to a matching element in the palette template, the second type element does not need a target element determined according to the matching element in the palette template; determining prediction information of the target color palette, And predictively encoding the target color palette according to the prediction information, so as to determine a set of matching elements of the at least one first type element in the target palette in the palette template, where
  • the palette template is composed of a set of matching elements and/or a set of non-matching elements, the set of matching elements including at least one matching element
  • the matching element is an element for matching the first type of
  • the prediction information includes an element prediction identifier, where the element prediction identifier is a prediction identifier of the palette template, where the palette template is predicted Identifying a set of the matching elements in the palette template and a set of the non-matching elements; or the element prediction identifier is a predicted identifier of an element in the palette template, wherein the The predicted identifier of the element in the swatch template is used to indicate that the element in the palette template is a matching element or a non-matching element; or the element prediction identifier is a predicted identifier of the target palette, wherein the target a prediction identifier of the palette for indicating a first type element and/or a second type element in the set of the target elements; or the element prediction And a predicted identifier of the element in the target palette, wherein the predicted identifier of the target element in the target palette is used to indicate that the target element is a first type element or a second type element;
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the set of matching elements are respectively a location of the corresponding first type of element in the set of the target element; or the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a first type of element corresponding to the matching element The position in the set of target elements.
  • the prediction information further includes first index information, where the first index information is used to indicate the matching element a corresponding position of all matching elements in the set in the palette template; or the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the palette template The corresponding position in .
  • the prediction information further includes first predicted difference information, where the first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; or the prediction information further includes second predicted difference information And wherein the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template.
  • the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether the target color palette is There is one of the first type of elements that can be determined based on the prediction information and the set of matching elements.
  • the method before the determining the prediction information of the target color palette, the method further includes: preset the color palette template.
  • the method further includes: The palette template is updated according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template.
  • the updating the palette template comprises: using the at least one second type element in the target palette, Updating a set of the non-matching elements in the palette template; updating the counter value corresponding to the element in the palette template by using the target element in the target palette.
  • a decoder including: a receiving unit, configured to acquire prediction information of a target palette from a code stream of a received target image block, where the target image block is a color palette An image block of an encoding mode, the target color palette being a set of target elements, each target element in the set of target image elements being representatively determined based on a sample point value of a signal component of the target image block a numerical value, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, The second type of element does not need to be determined according to the matching element in the palette template; the first determining unit is configured to determine, according to the prediction information received by the receiving unit, in the palette template a set of matching elements, wherein the palette template consists of a collection of matching elements and/or a collection of non-matching elements, the collection of matching elements At least one matching element, the matching
  • the prediction information includes an element prediction identifier, where the first determining unit is configured to: determine, according to the element prediction identifier, in the palette template A collection of matching elements.
  • the first determining unit is specifically configured to: when the element prediction identifier is a prediction identifier of the palette template, according to the The predictive identity of the palette template determines the matching elements in the palette template And a set of predictions of the palette template for indicating a set of the matching elements in the palette template and a set of the non-matching elements.
  • the prediction information when the set of matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location The information is used to indicate a position of the first type element corresponding to the set of the matching elements in the set of the target elements; when the number of matching elements in the set of the matching elements is less than the set of the target elements a number of the target elements, the second determining unit is specifically configured to: determine, according to the prediction identifier of the palette template, the first predicted location information, and the set of matching elements, the set of the target elements a value of the at least one first type of element and its location; obtaining a value of the at least one second type of element in the set of target elements from a code stream of the target image block.
  • the prediction information when the set of the matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location The information is used to indicate a position of the first type element corresponding to the set of the matching elements in the set of the target elements; when the number of matching elements in the set of the matching elements is equal to the target in the set of the target element a second determining unit, configured to: determine the at least one of the set of target elements according to the element prediction identifier, the first predicted location information, and the set of matching elements The value of the first type of element and its location.
  • the second determining unit is specifically configured to: sort the data according to the numerical value in ascending or descending order, and determine the target element according to the element prediction identifier and the set of the matching elements The values of all the target elements in the collection and their locations.
  • the prediction information further includes first predicted difference information, wherein the first predicted difference information is used And indicating a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit further And: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the first determining unit is specifically configured to: when the element prediction identifier is a predicted identifier of an element in the palette template, And determining, in sequence, the matching elements in the palette template according to the predicted identifiers of the elements in the palette template, all of the determined matching elements forming a set of the matching elements, wherein the palette template
  • the predicted identifier of the medium element is used to indicate that the element in the palette template is a matching element or a non-matching element.
  • the prediction information when the set of matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of matching elements is less than the target element in the set of the target element
  • the second determining unit is specifically configured to: determine, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of matching elements, in the set of the target elements a value and a position of the at least one first type element; obtaining a value of the at least one second type element in the set of the target elements from a code stream of the target image block.
  • the prediction information when the set of the matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of the matching element is equal to the target element in the set of the target element.
  • the second determining unit is specifically configured to: determine, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of the matching elements, the location in the set of the target elements The value and location of at least one first type of element.
  • the second determining unit when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to a number of target elements in the set of target elements, the second determining unit is specifically configured to: sort in ascending or descending order according to the numerical size, and predict the identifier and the matching according to the element A collection of elements that determine the value of all of the target elements in the set of target elements and their locations.
  • the prediction information further includes second prediction difference information, wherein the second prediction difference information a difference between the first type of elements in the target palette and a matching element in the palette template; the second determining unit is further configured to: according to the second predicted difference Information, adjusting a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes first index information, wherein the first index information is used to indicate the set of matching elements a corresponding position of all the matching elements in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is a predicted identifier of the target palette, and the target palette The prediction identifier indicates the at least one first type element in the target palette, and determining that all matching elements of the corresponding position indicated by the first index information in the palette template are formed in the palette A collection of matching elements in a template.
  • the second determining unit is specifically configured to: determine, according to the predicted identifier of the target palette, the first index information, and the set of matching elements, the at least one of the set of target elements The value and location of the class element; the value of the at least one second class element in the set of the target elements is obtained from the code stream of the target image block.
  • the second determining unit is specifically configured to: determine, according to the prediction identifier of the target palette, the first index information, and the set of matching elements, the at least one first category in the set of target elements The value and position of the element.
  • the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements
  • the second determining unit is specifically configured to: arrange the values of all the target elements in the set of the target elements according to the element prediction identifier and the set of matching elements according to the ascending or descending order of the numerical values position.
  • the prediction information further includes first prediction difference information, wherein the first prediction The difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit Further for: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of target elements.
  • the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the a corresponding position in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is a predicted identifier of an element in the target palette, and the prediction of the target element in the target palette The identifier is used to indicate that the target element is a first type of element, and the matching elements of the corresponding position indicated by the second index information in the palette template are sequentially determined, and all the matched elements determined are configured in the A collection of the matching elements in the palette template.
  • the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements
  • the second determining unit is specifically configured to: determine, according to the predicted identifier of the element in the target palette, the second index information, and the set of matching elements, the at least the set of the target elements a value and a position of a first type of element; obtaining a value of the at least one second type element in the set of the target elements from a code stream of the target image block.
  • the second determining unit is specifically configured to: determine the at least one of the set of the target elements according to the predicted identifier of the element in the target palette, the second index information, and the set of matching elements The value and location of the first type of element.
  • the number of matching elements in the set of the matching elements is less than or equal to the target element in the set of the target elements
  • the second determining unit is specifically configured to: arrange the values of all the target elements in the set of the target elements according to the element prediction identifier and the set of matching elements according to the ascending or descending order of the numerical values. Its location.
  • the prediction information further includes second predicted difference information, wherein the second The prediction difference information is used to indicate a difference between the first type of elements in the target palette and the matching elements in the palette template; the second determining unit is further configured to: according to the And predicting difference information, and adjusting a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes first index information, where the first index information is used to indicate the set of matching elements a corresponding position of all matching elements in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is the matching in the set of the matching elements in the palette template a number of elements, and the number is greater than or equal to 1, determining that all matching elements of the corresponding position indicated by the first index information in the palette template constitute a set of matching elements in the palette template, Wherein the number of the matching elements in the set of matching elements in the palette template is used to indicate the number of matching elements that can be found in the palette template for the target palette.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first class element in the set of target elements; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements,
  • the second determining unit is specifically configured to: determine the target according to the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements. a value and a location of the at least one first class element in the set of elements; obtaining a value of the at least one second class element of the set of target elements from a code stream of the target image block.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first type of elements in the set of target elements; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements,
  • the second determining unit is specifically configured to: according to the palette mode Determining, in the set of the matching elements in the set of the matching elements, the first predicted position information, and the set of the matching elements, determining a value of the at least one first type element in the set of the target elements And location.
  • the number of matching elements in the set of matching elements is less than or equal to the target in the set of the target elements
  • the second determining unit is specifically configured to: arrange in ascending or descending order of the numerical value, and determine, according to the element prediction identifier and the set of the matching elements, all the target elements in the set of the target elements The value and its location.
  • the prediction information further includes first prediction difference information, where The first predicted difference value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template;
  • the second determining unit is further configured to: adjust, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the Corresponding position in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is the number of the matching elements in the set of the matching elements in the palette template, and The number is greater than or equal to 1, and the matching elements of the corresponding positions indicated by the second index information in the palette template are sequentially determined, and all the matched elements determined to form a matching element in the palette template A collection of the number of matching elements in the set of matching elements in the palette template for indicating the number of matching elements that can be found in the palette template for the target palette.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target element, the second The determining unit is specifically configured to:: according to the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the matching a set of elements, determining a value and a position of the at least one first type element in the set of the target elements; acquiring the at least one of the set of the target elements from a code stream of the target image block The value of the second type of element.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of the matching element is equal to the number of the target elements in the set of the target element, the second determining The unit is specifically configured to: determine, according to the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the set of matching elements, The value and location of the at least one first type of element.
  • the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements
  • the second determining unit is specifically configured to: arrange the values of all the target elements in the set of the target elements according to the element prediction identifier and the set of the matching elements according to the ascending or descending order of the numerical values. And its location.
  • the prediction information further includes second predicted difference information, wherein The second prediction difference information is used to indicate a difference between the first type of elements in the target palette and the matching elements in the palette template; the second determining unit is further configured to: The second predicted difference information is adjusted to adjust a value of the at least one first type element in the set of target elements.
  • the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether the target color palette exists One of the first type of elements can be determined based on the prediction information and the set of matching elements.
  • the method further includes: a first preset unit, configured to determine, in the color palette, according to the prediction information
  • the palette template is preset before the collection of matching elements in the template.
  • the method further includes: a first updating unit, configured to determine, according to the prediction information and the set of matching elements, After the collection of the target elements, the palette template is updated according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template.
  • the first updating unit is specifically configured to: utilize the at least one second in the target palette a class element, updating a set of the non-matching elements in the palette template; updating the counter value corresponding to the element in the palette template by using the target element in the target palette.
  • an encoder comprising: a construction unit, configured to construct a target palette, wherein the target palette is a collection of target elements, and each target element in the set of target elements is a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one first class element and/or at least one second class element, the One type of element is a target element that needs to be determined according to a matching element in a palette template, the second type element does not need a target element determined according to a matching element in the palette template; a pre-processing unit for determining the configuration Predicting information of the target palette constructed by the unit, and predictively encoding the target palette according to the prediction information, so as to determine that the at least one first type element in the target palette is in the a collection of matching elements in a palette template, wherein the palette template consists of a collection of matching elements and/or a collection of non-matching elements,
  • the set of matching elements includes at
  • the prediction information includes an element prediction identifier, where the element prediction identifier is a prediction identifier of the palette template, where the palette template is predicted Identifying a set for indicating the matching element in the palette template And a set of the non-matching elements; or the element prediction identifier is a predicted identifier of an element in the palette template, wherein a predicted identifier of an element in the palette template is used to indicate the palette template
  • the element is a matching element or a non-matching element; or the element predictive identifier is a predicted identifier of the target palette, wherein the predicted identifier of the target palette is used to indicate in the set of the target element a first type of element and/or a second type of element; or the element prediction identifier is a predicted identifier of an element in the target palette, wherein a predicted identifier of the target element in the target palette is used to indicate the target
  • the element is a first type element or a second
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the set of the matching elements are respectively a location of the corresponding first type of element in the set of the target element; or the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a first type of element corresponding to the matching element The position in the set of target elements.
  • the prediction information further includes first index information, where the first index information is used to indicate the matching element a corresponding position of all matching elements in the set in the palette template; or the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the palette template The corresponding position in .
  • the prediction information further includes first predicted difference information, where the first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; or the prediction information further includes second predicted difference information And wherein the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template.
  • the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether a target exists in the target color palette
  • the first type of element can match the prediction according to the prediction information Determined by the collection of elements.
  • the method further includes: a second preset unit, configured to: before the determining the prediction information of the target color palette, preset The palette template.
  • the method further includes: a second updating unit, configured to perform predictive coding on the target color palette according to the prediction information, Updating the palette template according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template.
  • the second updating unit is specifically configured to: update by using the at least one second type element in the target color palette a set of the non-matching elements in the palette template; updating the counter value corresponding to the element in the palette template by using the target element in the target palette.
  • Embodiments of the present invention predictively encode a target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
  • FIG. 1 is a flow chart of a decoding method of a target image block according to an embodiment of the present invention.
  • FIG. 2 is a flow chart of a method of encoding a target image block in accordance with an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a decoder according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a decoder according to another embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a decoder according to another embodiment of the present invention.
  • Figure 6 is a block diagram showing the structure of an encoder in accordance with one embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an encoder according to another embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an encoder according to another embodiment of the present invention. detailed description
  • Palette Consists of a set of elements, each of which is the representative sample point value of all the sample points of the signal component of the target image block, where the size of the palette is the number of elements in the palette.
  • the number and value of the elements in the palette can be determined by a dynamic programming algorithm.
  • Target palette A palette of one signal component in the target image block.
  • the target image block is an image block in the palette encoding mode.
  • the signal component may be any one of the signal components of the target image block.
  • the signal format of the target image block is YUV
  • one of the signal components may be any of the Y, U, and V components.
  • the signal format of the target image block is RGB
  • one signal component may be any one of the 1, G, and B components.
  • Palette template Initializes a set of elements at the beginning of a sequence or an image or a slice encoding process, setting all of them to a predetermined initial value (such as -1 ).
  • the elements in the palette template can be used to predict the elements in the target palette.
  • S 1 1 obtaining prediction information of a target palette from a code stream of the received target image block, wherein the target image block is an image block in a palette encoding mode, and the target color palette is a target a set of elements, each of the set of target elements being a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one a first type of element and/or at least one second type of element, the first type of element being a target element that needs to be determined according to a matching element in the palette template, the second type of element not being based on the palette template Matches the target element determined by the element.
  • the target element in the target palette is likely to find a match in the palette template.
  • the element may also not find a matching element in the palette template.
  • the prediction information may include an element prediction identifier.
  • the element prediction identifier may be a predictive identifier of an element in the palette template to indicate whether the element in the palette template is a matching element of the first type of element in the target palette. For example, you can transfer a binary symbol to each element in the palette template as the predictive identifier for the element in the palette template. When the predicted identifier of an element in the palette template is 1, it indicates that the element is a matching element of the first type of element in the target palette; when the predicted identifier of the element in the palette template is
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate that the matching element corresponds to the first The position of the class element in the set of target elements.
  • the second predicted position information may be identified using a variable length codeword or a fixed length codeword. If the length of the target palette is 1 6 , a fixed length codeword of length 4 can be used to identify the second predicted location information.
  • the element prediction identifier may be a prediction identifier of the palette template, where the prediction identifier of the palette template is used to indicate the set of the matching elements in the palette template and the non-matching element Collection. For example, if there are 4 elements in the palette template, the prediction identifier of the palette template is (1, 0, 0, 1) Yes, indicating that the first and fourth elements in the palette template are matching elements. The second and third elements are non-matching elements.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching element. The position of the corresponding first class element in the set of the target element.
  • the element prediction identifier may also be a prediction identifier of an element in the target palette, which is used to indicate whether the target element in the target palette is a first type element or a second type element, that is, whether the target element can be in the color palette. Find the matching element in the template. For example, a binary symbol can be transmitted for each target element in the target palette as a predictive identifier for the element in the target palette. If the element prediction identifier indicates that the target element can find its matching element in the palette template, the prediction information further includes second index information indicating a corresponding position of the matching element in the palette template. . A fixed length codeword or a variable length codeword can be used to identify the second index Information.
  • the palette template size is 8 (ie, it contains 8 elements)
  • a fixed length codeword of length 3 can be used as the second index information to identify the location of the matching element, or to identify the matching element. Which of these 8 elements is.
  • a truncated unary code having a maximum value of 8 can be used as the second index information to identify the location of the matching element.
  • the element prediction identifier is a prediction identifier of the target palette, where the prediction identifier of the target palette is used to indicate a first type element and/or a second type element in the set of the target element .
  • the predicted identifier ( 1 , 0, 0, 1 , 1 , 0 ) of the target palette indicates that the first, fourth, and fifth target elements are the first type of target elements.
  • the second, third, and sixth target elements are the second type of target elements.
  • the prediction information may further include first index information, where the first index information is used to indicate that all the first type elements correspond to A corresponding position of all matching elements in the set of matching elements in the palette template.
  • the element prediction identifier may also be the number of matching elements in the set of matching elements in the palette template for indicating the number of matching elements that can be found in the palette template for the target palette.
  • the prediction information further includes first index information and first predicted location information.
  • the prediction information may further include second index information and second predicted location information, it being understood that the number of the second index information or the second predicted location information is the number of matching elements in the palette template.
  • the prediction information may further include first prediction difference information or second prediction difference information.
  • the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and its matching elements in the palette template.
  • the second predicted difference information can be further decomposed into the predicted difference absolute value and the predicted difference sign. It is only necessary to obtain the predicted difference symbol when the absolute value of the prediction difference is not zero.
  • a fixed length codeword or a variable length codeword may be used to identify the absolute value of the predicted difference value, and a maximum value may be set for the absolute value of the predicted difference value, which may be preset or from the code stream. obtain. For example, when the maximum value of the prediction difference is preset to be 3, a fixed length codeword of length 2 may be used to identify the absolute value of the prediction difference, or a truncated unary code having a maximum value of 3 may be used to identify the prediction difference.
  • the absolute value of the value For example, a binary symbol can be used to identify the predicted predicted difference symbol. For example, the binary symbol 0 can be used to indicate that the prediction difference is a negative number, and the binary symbol 1 is used to indicate that the prediction difference is a positive number.
  • the first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and its matching elements in the palette template.
  • the prediction information may include one prediction indication information.
  • the prediction indication information is used to indicate whether the target palette uses the palette prediction method described in the present invention, that is, whether at least one first type element in the target palette can be determined according to the prediction information and the set of matching elements.
  • the prediction indication information may be a binary symbol, the symbol 0 may be used to indicate that the palette prediction method is not used, and the symbol 1 is used to indicate the palette prediction method. If the target palette does not use the palette prediction method, then each target element in the palette can be determined according to the prior art method.
  • S 1 2 determining, according to the prediction information, a set of the matching elements that match the at least one first element in a palette template, wherein the palette template is composed of a matching element and/or a a set of matching elements, the set of matching elements including at least one matching element, the matching element is an element for matching the first type of element, and the difference between the value of the first type of element and the value of the matching element
  • the absolute value is less than a predetermined value
  • the set of non-matching elements includes at least one non-matching element, which is an element that cannot match the first type of element.
  • the elements in the palette template may or may not match the target palette.
  • how the set of matching elements in the palette template is determined by the prediction information.
  • a set of matching elements in the palette template can be determined by an element prediction identifier.
  • the element prediction identifier is a predicted identifier of the palette template
  • determining a set of matching elements in the palette template according to the predicted identifier of the palette template wherein The prediction identifier of the palette template is used to indicate a set of the matching elements in the palette template and a set of the non-matching elements.
  • the element prediction identifier is an element in the palette template a prediction identifier, which in turn determines a matching element in the palette template according to a predicted identifier of an element in the palette template, wherein all of the determined matching elements constitute a set of the matching elements, wherein the adjustment
  • the predictive identity of the element in the swatch template is used to indicate that the element in the palette template is a matching element or a non-matching element.
  • the element prediction identifier is a predicted identifier of the target palette
  • the predicted identifier of the target palette indicates the at least one first category in the target palette
  • the element prediction identifier is a predicted identifier of an element in the target palette
  • a predicted identifier of the target element in the target palette is used to indicate that the target element is a first category
  • the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1
  • determining the palette All matching elements of the corresponding position indicated by the first index information in the template constitute a set of matching elements in the palette template, wherein the matching elements in the set of matching elements in the palette template The number is used to indicate the number of matching elements that can be found in the palette template for the target palette.
  • the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determining the coloring in sequence A matching element of a corresponding position indicated by the second index information in the board template, all of the determined matching elements constitute a set of matching elements in the palette template.
  • the prediction information includes both the prediction indication information and the element prediction flag, it is only necessary to acquire the element prediction flag from the code stream if the prediction indication information indicates that the target palette performs prediction processing.
  • the element prediction identifier is a predicted identifier of an element in the palette template, then when the palette mode When the element predictive identifier of an element in the board indicates that the element is a matching element of the first type of element of the target palette, it may be determined that the element in the palette template is a first type of element in the target palette. Matching elements in the swatch template. For example, the number of elements in the palette template is 8, and the eight elements are (62, 89, 110, 128, 154, 189, 205, 240), and the element prediction identifier may be (0, 0, 0, 1, 1, 0, 1, 0), 0 indicates that the element in the palette template is not a matching element, and 1 indicates that the element in the palette template is a matching element.
  • elements 62, 89, 110, 189 and 240 in the palette template their corresponding element prediction ID is 0, indicating that they are non-matching elements
  • elements 128, 154 and 205 in the palette template their corresponding elements
  • the prediction ID is 1, indicating that they are matching elements.
  • the element prediction identifier, 128, 154, and 205 can be determined as matching elements of the target element in the palette template in the target palette.
  • the element prediction identifier is (0, 0, 0, 0, 0, 0, 0, 0), it indicates that there is no set of matching elements in the palette template.
  • the prediction identifier is an element prediction identifier of an element in the target palette
  • an element prediction identifier of a target element in the target palette indicates that the target element can find its matching element in the palette template
  • the second index information needs to be further obtained from the code stream, and the location of the matching element in the palette template is determined according to the second index information, or the matching element is equivalently determined.
  • the element prediction flag may be (1, 0, 0, 0, 1, 1). Where 0 indicates that the target element in the target palette cannot find its matching element in the palette template, that is, the second type of element; 1 indicates that the target element in the target palette can be found in the palette template Its matching element is the first type of element.
  • the second index information is 4, 3, and 6, respectively.
  • the number of elements in the palette template is 8, 8 elements are (62, 89, 110, 128, 154, 189, 205, 240).
  • the matching elements of the first, fifth, and sixth target elements in the target palette are 154, 128, and 205, respectively.
  • the element prediction identifier is (0, 0, 0, 0, 0, 0)
  • the first type of element does not exist, and only the second type of element exists.
  • the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, when the element prediction identifier indicates that the number of matching elements in the palette template is not 0
  • the second index information needs to be further obtained from the code stream, and the position of the matching element in the palette template is determined according to the second index information, or the matching element is equivalently determined.
  • the number of matching elements in the obtained palette template is 3, indicating that there are 3 target elements in the target palette to find matching elements in the palette template.
  • the number of elements in the palette template is 8, and the eight elements are (62, 89, 1 1 0, 128, 154, 189, 205, 240).
  • the obtained three second index information are 4, 3, and 6, respectively.
  • it is determined that the matching elements of the target element in the target palette in the palette template are 154, 128, and 205, respectively.
  • the prediction information further includes a first predicted location information, where the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, according to the prediction information and the set of matching elements, Determining the set of the target elements, including: determining, according to the predicted identifier of the palette template, the first predicted location information, and the set of matching elements, the at least one of the set of target elements A value and a position of a class of elements; a value of the at least one second class element in the set of the target elements is obtained from a code stream of the target image block.
  • the target element when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements.
  • the collecting comprising: determining a value and a location of the at least one first type element in the set of the target elements according to the element prediction identifier, the first predicted location information, and the set of matching elements.
  • the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, according to the prediction information And determining, by the set of the matching elements, the set of the target elements, including: determining the target according to the set of element prediction identifiers and the matching elements according to a predetermined manner (eg, ascending or descending order of numerical values) The value of all of the target elements in the collection of elements and their locations.
  • a predetermined manner eg, ascending or descending order of numerical values
  • the prediction information may further include first prediction difference information, where the determining, according to the element prediction identifier, the first predicted location information, and the set of matching elements, determining a location in the set of target elements
  • the at least one first type of element includes: adjusting a value of the at least one first type element in the set of the target elements according to the first predicted difference information.
  • the prediction information further includes second predicted location information, when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, according to the prediction information and the matching element And determining a set of the target elements, including: determining, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of matching elements, in the set of the target elements a value and a position of the at least one first type element; obtaining a value of the at least one second type element in the set of the target elements from a code stream of the target image block.
  • determining the target element according to the prediction information and the set of matching elements includes: determining, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of matching elements, the at least one first class element in the set of the target elements.
  • the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, according to the prediction information And determining, by the set of the matching elements, the set of the target elements, including: sorting in ascending or descending order according to a numerical size, determining, according to the element prediction identifier and the set of matching elements, all of the set of the target elements The value of the target element and its location.
  • the prediction information further includes second prediction difference information, the determining the set of the target elements according to the prediction identifier of the element in the palette template, the second predicted location information, and the set of matching elements.
  • the at least one first type element in the method comprising: adjusting a value of the at least one first type element in the set of the target elements according to the second predicted difference information.
  • the matching element can be used as a pre-corresponding first element in the target palette. Measured value.
  • the second predicted difference information is also obtained from the code stream.
  • the matching element of the first type element in the target palette is 86
  • the number of matching elements in the set of matching elements determined in step S12 is less than Determining the number of the target elements in the set of the target elements, the determining the set of the target elements according to the prediction information and the set of the matching elements, including: according to the prediction identifier of the target color palette, a first index information and a set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; acquiring the target element from a code stream of the target image block The value of the at least one second type element in the collection.
  • the target element when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And determining, according to the prediction identifier of the target palette, the first index information, and the set of matching elements, determining a value and a location of the at least one first type element in the set of target elements .
  • the set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
  • the prediction information further includes first prediction difference information, where the determining, according to the prediction identifier of the target palette, the first index information, and the set of matching elements, determining the set of target elements
  • the at least one first type of element comprising: adjusting a value of the at least one first type element in the set of target elements according to the first predicted difference information.
  • the number of matching elements in the set of matching elements determined in step S12 is less than The number of target elements in the set of target elements, according to the predicted letter
  • determining, by the set of the matching elements, the set of the target elements including: determining the target according to the predicted identifier of the element in the target palette, the second index information, and the set of the matching elements a value and a location of the at least one first class element in the set of elements; obtaining a value of the at least one second class element of the set of target elements from a code stream of the target image block.
  • the target element when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And determining, according to the prediction identifier of the element in the target color palette, the second index information, and the set of the matching elements, determining a value of the at least one first type element in the set of the target elements And location.
  • the set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
  • the prediction information further includes second prediction difference information, where the determining the target element according to the prediction identifier of the element in the target palette, the second index information, and the set of matching elements
  • the at least one first class element in the set comprising: adjusting a value of the at least one first class element in the set of the target elements according to the second predicted difference information.
  • the prediction information further includes first predicted location information, And when the number of matching elements in the set of matching elements determined in step S12 is less than the number of target elements in the set of the target elements, the set according to the prediction information and the matching element Determining the set of the target elements, including: determining, according to the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements And a value of the at least one first type element in the set of target elements; and a value of the at least one second type element in the set of the target elements is obtained from a code stream of the target image block.
  • the target element when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And determining, according to the set of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements, determining the set of the target elements The value and location of the at least one first type of element.
  • the set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
  • the prediction information further includes first prediction difference information, the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the matching a set of the elements, the determining the at least one first type element in the set of the target elements, comprising: adjusting the at least one first category in the set of the target elements according to the first predicted difference information The value of the element.
  • the prediction information further includes second predicted location information, And when the number of matching elements in the set of matching elements determined in step S12 is less than the number of target elements in the set of the target elements, the set according to the prediction information and the matching element Determining the set of the target elements, including: determining, according to the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the set of matching elements, And a value of the at least one first type element in the set of target elements; and a value of the at least one second type element in the set of the target elements is obtained from a code stream of the target image block.
  • the set includes: a set of the matching elements in the set of matching elements in the palette template, the second predicted location information, and a set of the matching elements And determining a value and a location of the at least one first class element in the set of the target elements.
  • the set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
  • the prediction information further includes second prediction difference information, the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the matching And determining, by the set of the at least one first class element in the set of the target elements, the: adjusting, according to the second predicted difference information, the at least one first class in the set of the target elements The value of the element.
  • all target elements of the target palette can be sorted according to a given order to determine the position of each target element in the target palette.
  • each target element in the target palette can be sorted in ascending or descending order according to the value of the target element to determine the position of each target element.
  • the set of matching elements when the set of matching elements is non-empty, and the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, according to the prediction information and the And determining, by the set of matching elements, the set of the target elements, including: sorting in ascending or descending order according to a numerical value, determining, according to the element prediction identifier and the set of matching elements, determining all target elements in the set of the target elements The value and its location.
  • the matching elements in the set of matching elements are arranged in ascending or descending order to determine the value and position of the target element in the set of target elements.
  • determining the set of the target elements comprising: arranging in ascending or descending order according to a numerical size, determining, according to the element prediction identifier and the set of matching elements, all target elements in the set of the target elements The value and its location. That is, except In addition to the determined set of matching elements, all second type elements need to be obtained from the code stream, and the set of matching elements and all the second type elements are arranged in ascending or descending order to determine the target in the set of target elements. The value and position of the element.
  • All target elements of the target palette may also be sorted according to the first or second predicted position information to determine the position of each target element in the target palette.
  • the following is an example of how to determine the location of a target element in the set of target elements based on the predicted location information.
  • the element prediction identifier is a predicted identifier of an element in a palette template
  • when an element of the palette template predicts an element indicating that the element is an element of the target palette it can be determined that the element in the palette template is a matching element of a target element in the palette template in the target palette, and the matched element in the target palette can be obtained from the code stream. Location information. For the unmatched elements in the target palette, the target palette can be filled in the given order after being acquired from the code stream.
  • the number of palette template elements is 8, and 8 elements are respectively (62, 89, 110 , 128, 154, 189, 205, 240), the element prediction identifier may be (0, 0, 0, 1, 1, 0, 1, 0), 0 indicates that the element in the palette template is not a matching element, 1 indicates a palette template element as a matching element.
  • the prediction identifier is 1, indicating that they are matching elements. At this time, the predicted position information of the matched elements in the target palette can be obtained.
  • the obtained position information of the three elements is (0, 4, 5).
  • the target palette can be determined as (128, UN, UN, UN, 154, 205), and UN represents the remaining undetermined elements.
  • the three undetermined target elements are then retrieved from the code stream, for example, the three target elements acquired are 200, 155, and 202, and placed in a vacant position of the target palette.
  • Elements acquired from the code stream can be placed into the target palette according to pre-defined rules. For example, you can place them in order from front to back, and make sure the target palette is (128, 200, 155, 202, 154, 205).
  • the element prediction identifier is the number of matching elements in the palette template
  • the predicted identifier indicates that the number of matching elements in the palette template is not 0, further from the code stream is needed.
  • Obtaining index information the number of the index information being the prediction identifier
  • the position of the matching element in the palette template may be determined according to the index information, or the matching element may be equivalently determined.
  • the predicted position information of the matching element may also be obtained from the code stream, and the target palette is not Matching elements, obtained from the stream, can populate the target palette in the given order.
  • the number of matching elements in the obtained palette template is 3, indicating that 3 elements in the target palette can find matching elements in the palette template.
  • the number of palette template elements is 8, and the eight elements are (62, 89, 110, 128, 154, 189, 205, 240).
  • the obtained three index information is 3, 4, 6.
  • the matching elements of the elements in the target palette in the palette template are 128, 154, and 205, respectively.
  • the predicted position information of the matched elements in the target palette can be obtained.
  • the obtained position information of the three elements is (0, 4, 5), respectively, and it is assumed that there are six elements in the target palette.
  • the target palette can be determined as (128, UN, UN, UN, 154, 205), and UN represents the remaining undetermined elements.
  • the three undetermined target elements are then retrieved from the code stream, for example, the three target elements acquired are 200, 155, and 202, and placed in a vacant position of the target palette.
  • the target elements obtained from the code stream can be placed into the target palette according to a predetermined rule. For example, it can be placed in order from front to back, and the target palette is determined to be (128, 200, 155, 202, 154, 205).
  • the target palette can be used to decode the corresponding signal components of the target image block.
  • An index table of signal components of the target image block is parsed, and the parsing operation can be performed using methods in the prior art.
  • the reconstructed value of each of the signal components in the target image block is obtained by indexing from the target palette using the parsed index table. Specifically, for a sample point of the target block, find the index value of the corresponding position of the index table. The target palette is indexed by the index value, and the value of the element in the target palette indexed is used as the reconstructed value of the sample point. Perform the same operation on all the sample points in the target image block to obtain the reconstructed values of all the sample points of the target image block. For the reconstructed target image block, the reconstructed image block can be subsequently filtered using a deblocking filter or the like. Work.
  • a similar decoding operation can be performed on all signal components in the target image block.
  • the embodiment of the present invention further reduces the coding overhead of the target palette by, for example, predicting a message, a packet, and pre-coding the target color palette, thereby further improving the video image of the palette color coding mode. Compression efficiency.
  • a preset palette template is further included.
  • the palette template After determining the set of the target elements according to the prediction information and the set of matching elements, further comprising: matching the target elements in the set of target elements and the matching in the palette template The counter value corresponding to the element, the palette template is updated.
  • the palette template needs to be updated.
  • a counter can be used for each element in the palette template, which is updated based on the number of occurrences of the element and the length of time the element has been in the palette template.
  • the palette template can be updated based on the counter value of the element and the elements in the target palette.
  • each element counter of the palette template When updating the palette, first reduce the value of each element counter of the palette template by a preset value (such as 1). Then iterate through the elements in the palette template, check each element in the target palette for each element, and see if there is a target palette element that can hit the palette template element. If it exists, then adjust the element. Swatch template element counter value is incremented by a preset value
  • the hit refers to the absolute value of the difference between the values of the two elements within a predetermined range (such as 3).
  • the new element refers to an element in the target palette that does not hit any of the elements in the palette template.
  • the inserting a new element into the palette template refers to finding an element with the smallest counter value in the palette template. If the element calculates its value below a preset value (such as 1), the color is replaced by the new element. Board template element. If there are multiple palette elements with the same minimum counter value, then one is selected for replacement in the given order (eg, the order of the elements in the palette template from small to large). For the element just inserted into the palette template, its counter The value is set to a predetermined initial value (such as 2).
  • the number of elements in the palette template is 8, 8 elements are (62, 89, 110, 128, 154, 189, 205, 240), and the counter value is (3, 3, 2, 2, 2, 1, 1, 1), the target elements in the target palette are (70, 128, 154, 205, 255).
  • the counter status changes to ( 2, 2, 1, 1, 1, 0, 0, 0).
  • the counter status changes to ( 2, 2, 1, 4, 4, 0, 3, 0).
  • the minimum counter value in the current palette template is 0, and the corresponding palette template elements are 240 and 189.
  • the position index of element 189 in the palette template is small, so 189 can be replaced with 70, while the counter value of element 70 is set to 2, and the palette template becomes (62, 89, 110, 128, 154, 70). , 205, 240 ), the counter status changes to ( 2, 2, 1, 4, 4, 2, 3, 0).
  • the counter value in the current palette template is 0, and the corresponding palette template matching element is 240, so use 240 to replace 240, and set the counter value of element 255 to 2, then the palette
  • the template changes to ( 62, 89, 110, 128, 154, 70, 205, 255 ) and the counter status changes to ( 2, 2, 1, 4, 4, 2, 3, 2).
  • the target palette update is complete.
  • the embodiment of the present invention further reduces the coding overhead of the target palette by, for example, predicting a message, a packet, and pre-coding the target color palette, thereby further improving the video image of the palette color coding mode. Compression efficiency.
  • S21 Construct a target palette, where the target palette is a set of target elements, and each target element in the set of target elements is determined based on a sample point value of a signal component of the target image block. a representative value, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first class element being determined according to a matching element in the palette template A target element that does not require a target element determined from matching elements in the palette template.
  • the palette template is composed of a set of matching elements and/or a set of non-matching elements, the set of matching elements including at least one matching element, the matching An element is an element for matching the first type of element, an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value, and the set of the non-matching element includes at least one non-matching element, The non-matching element is an element that cannot match the first type of element.
  • the prediction information may include an element prediction identifier.
  • the element prediction identifier is a predicted identifier of the palette template, wherein the prediction identifier of the palette template is used to indicate a set of the matching elements in the palette template and the non-matching element set.
  • the element prediction identifier is a predicted identifier of the element in the palette template, wherein the predicted identifier of the element in the palette template is used to indicate that the element in the palette template is a matching element or a non-matching element .
  • the element prediction identifier is a prediction identifier of the target palette, wherein the prediction identifier of the target palette is used to indicate a first type element and/or a second type element in the set of the target elements.
  • the element prediction identifier is a predicted identifier of an element in the target palette, wherein the predicted identifier of the target element in the target palette is used to indicate that the target element is a first type element or a second type element.
  • the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, used to indicate that a matching element can be found in the palette template for the target palette Number.
  • the prediction information further includes first predicted location information or second predicted location information.
  • the first predicted location information is used to indicate a location of the first type element corresponding to the set of the matching elements in the set of the target elements.
  • the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of the target element.
  • the prediction information may further include first index information or second index information.
  • the first index information is used to indicate a corresponding position of all matching elements in the set of matching elements in the palette template; the second index information is used to indicate that the matching element is in the palette template. Corresponding location.
  • the prediction information may further include first predicted difference information or second predicted difference information.
  • the first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and its matching elements in the palette template.
  • the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template.
  • the prediction information may further include prediction indication information.
  • the prediction indication information is used to indicate whether one of the first type of elements in the target palette is determined according to the prediction information and the set of matching elements.
  • the prediction indication information can be obtained by pre-processing the image, or it can be preset to always use the palette prediction method.
  • An index table is created for the signal component to which the target palette belongs. For a sample point in the target image block, a numerically closest element can be found in the palette template such that the element value has the smallest error from the sample value. At this point, the value of the element in the palette template can be selected as the reconstructed value of the sample point, and the index value of the element (i.e., the reconstructed value) in the palette template can be determined. All of the sample points of the signal component of the target image block can be determined in a similar manner to their reconstructed values and determine the index value of the reconstructed value in the palette template. The index values of all the sample points constitute an index table. The palette template and index table information of the signal component to which the target palette belongs is written to the code stream.
  • the embodiment of the present invention further reduces the coding overhead of the target palette by, for example, predicting a message, a packet, and pre-coding the target color palette, thereby further improving the video image of the palette color coding mode. Compression efficiency.
  • the palette mode can also be preset. Board.
  • the preset palette template is used.
  • the counter value updates the palette template. For example, updating the set of the non-matching elements in the palette template by using the at least one second class element in the target palette; using the target element in the target palette, Update the counter value corresponding to the element in the palette template. In this way, the palette template used is updated in real time.
  • the embodiment of the present invention predictively encodes the target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
  • 3 to 5 illustrate a decoder for realizing a decoding method of a target image block according to an embodiment of the present invention.
  • the decoder 30 includes a receiving unit 31, a first determining unit 32, a second determining unit 33, and a decoding unit 34. among them:
  • the receiving unit 31 is configured to obtain prediction information of a target palette from a code stream of the received target image block, where the target image block is an image block in a palette encoding mode, and the target color palette is a set of target elements, each of the set of target elements being a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least a first class element and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, the second class element not being according to the palette template The target element determined by the matching element;
  • the first determining unit 32 is configured to determine, according to the prediction information received by the receiving unit 31, a set of matching elements in the palette template, where the palette template is composed of a matching element and/or a set of non-matching elements, the set of matching elements including at least one matching element, the matching element being an element for matching the first type of element, the value of the first type of element and the value of the matching element
  • the absolute value of the difference is less than a predetermined value
  • the set of non-matching elements includes at least one non-matching element, and the non-matching element is unable to communicate with the first The element that the class element matches;
  • the second determining unit 33 is configured to determine, according to the prediction information, the set of the matching elements determined by the first determining unit 32, the set of the target elements;
  • the decoding unit 34 is configured to decode the target image block according to the set of the target elements determined by the second determining unit 33.
  • the first determining unit 32 is configured to determine a set of matching elements in the palette template according to the element prediction identifier.
  • the first determining unit 32 is configured to: when the element prediction identifier is a prediction identifier of the palette template, determine, according to the prediction identifier of the palette template, in the palette template. A set of matching elements, wherein the predictive identifier of the palette template is used to indicate a set of the matching elements in the palette template and a set of the non-matching elements.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the first type of elements corresponding to the set of matching elements respectively a position in the set of target elements; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, the second determining unit 33 is configured to: a prediction identifier of the board template, the first predicted location information, and the set of matching elements, determining a value of the at least one first class element in the set of target elements and a location thereof; from the target image block Obtaining a value of the at least one second type element in the set of the target elements in the code stream.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the first type of elements corresponding to the set of matching elements respectively a position in the set of target elements; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: predict the identifier according to the element And determining, by the first predicted location information and the set of matching elements, a value of the at least one first class element in the set of target elements and a location thereof.
  • the second determining unit 33 is configured to: : sorted in ascending or descending order of numerical values, based on the element prediction identifier And a set of the matching elements, determining a value of all of the target elements in the set of the target elements and a location thereof.
  • the prediction information further includes first predicted difference information, wherein the first predicted difference information is used to indicate each of the at least one first type element in the target palette and a difference value of matching elements in the palette template; the second determining unit
  • 33 is configured to: adjust a value of the at least one first type element in the set of the target elements according to the first predicted difference information.
  • the first determining unit 32 is configured to: when the element prediction identifier is a predicted identifier of an element in the palette template, determine, according to the predicted identifier of the element in the palette template, the color to be determined a matching element in the board template, the determined all of the matching elements forming a set of the matching elements, wherein the predicted identifier of the element in the palette template is used to indicate that the element in the palette template is Matching elements or non-matching elements.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate that the first type element corresponding to the matching element is in the target element a position in the set; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, the second determining unit 33 is configured to: according to the palette Determining, by the predicted identifier of the element in the template, the second predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; from the target image block Obtaining a value of the at least one second type element in the set of the target elements in the code stream.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate that the first type element corresponding to the matching element is in the target element a position in the set; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: according to the palette template A prediction identifier of the medium element, the second predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements.
  • the second The determining unit 33 is configured to: arrange the values of all the target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements according to the ascending or descending order of the numerical values.
  • the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the first type of element in the target palette and its in the palette template
  • the second determining unit 33 is further configured to: adjust a value of the at least one first type element in the set of the target elements according to the second predicted difference information.
  • the prediction information further includes first index information, where the first index information is used to indicate a corresponding location of all matching elements in the set of matching elements in the palette template;
  • the unit 32 is configured to: when the element prediction identifier is a predicted identifier of the target palette, and the predicted identifier of the target palette indicates the at least one first type element in the target palette, Determining that all of the matching elements of the corresponding position indicated by the first index information in the palette template constitute a set of matching elements in the palette template.
  • the second determining unit 33 is configured to:: predictive identifier according to the target color palette And determining, by the first index information and the set of matching elements, a value and a location of the at least one first type element in the set of target elements; acquiring the code from a code stream of the target image block The value of the at least one second type element in the set of target elements.
  • the second determining unit 33 is configured to:: according to the predicted identifier of the target color palette, And determining, by the first index information and the set of matching elements, a value and a location of the at least one first class element in the set of the target elements.
  • the second determining unit 33 is configured to: sort in ascending or descending order according to the numerical value Determining, according to the element prediction identifier and the set of matching elements, a value of all target elements in the set of the target elements and a location thereof.
  • the prediction information further includes first prediction difference information, wherein the first prediction difference The value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit
  • the method is further configured to: adjust, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes second index information, where the second index information is used to indicate a corresponding location of the matching element in the palette template;
  • the first determining unit 32 is configured to: And when the element prediction identifier is a prediction identifier of an element in the target palette, and a prediction identifier of the target element in the target palette is used to indicate that the target element is a first type element, determining the A matching element of a corresponding position indicated by the second index information in the palette template, all of the determined matching elements constitute a set of the matching elements in the palette template.
  • the second determining unit 33 is configured to: according to the elements in the target palette Determining an identifier, the second index information, and the set of matching elements, determining a value and a location of the at least one first type element in the set of target elements; obtaining from a code stream of the target image block a value of the at least one second type of element in the set of target elements.
  • the second determining unit 33 is configured to: predict according to elements in the target color palette And the identifier, the second index information, and the set of matching elements determine a value and a location of the at least one first class element in the set of target elements.
  • the second determining unit 33 is configured to: sort in ascending or descending order according to the numerical value Determining, according to the element prediction identifier and the set of matching elements, a value of all target elements in the set of the target elements and a location thereof.
  • the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the first type of element in the target palette and its in the palette template
  • the second determining unit 33 is further configured to: adjust, according to the second predicted difference information, the at least one first category in the set of the target elements The value of the element.
  • the prediction information further includes first index information, where the first index information is used to indicate a corresponding location of all matching elements in the set of matching elements in the palette template; a determining unit 32 is configured to: when the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determining the palette All matching elements of the corresponding position indicated by the first index information in the template constitute a set of matching elements in the palette template, wherein the matching elements in the set of matching elements in the palette template The number is used to indicate the number of matching elements that can be found in the palette template for the target palette.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate a location of the first class element corresponding to the set of the matching elements in the set of the target elements;
  • the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements
  • the second determining unit 33 is configured to: according to the set of the matching elements in the palette template Determining a number of the matching elements, the first predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; from the target image Obtaining a value of the at least one second type element in the set of the target elements in a code stream of the block.
  • the prediction information further includes first predicted location information, where the first predicted location information is used to indicate a location of the first type element corresponding to the set of the matching elements in the set of the target element;
  • the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: according to the set of the matching elements in the palette template The number of matching elements, the first predicted location information, and the set of matching elements determine a value and a location of the at least one first class element in the set of target elements.
  • the second determining unit 33 is configured to: sort in ascending or descending order according to the numerical value Determining, according to the element prediction identifier and the set of matching elements, a value of all target elements in the set of the target elements and a location thereof.
  • the prediction information further includes first prediction difference information, wherein the first prediction difference The value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit
  • the method is further configured to: adjust, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
  • the prediction information further includes second index information, where the second index information is used to indicate a corresponding location of the matching element in the palette template;
  • the first determining unit 32 is configured to: when the element prediction identifier is the number of the matching elements in the set of the matching elements in the palette template, and the number is greater than or equal to 1, sequentially determining that the palette template is a matching element of the corresponding location indicated by the second index information, all of the determined matching elements forming a set of matching elements in the palette template, wherein the set of matching elements in the palette template is The number of matching elements is used to indicate the number of matching elements that can be found in the palette template for the target palette.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of target elements; when the matching element The number of matching elements in the set is less than the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: according to the set of the matching elements in the palette template Determining, by the number of matching elements, the second predicted location information, and the set of matching elements, a value and a location of the at least one first class element in the set of target elements; a code from the target image block The value of the at least one second type element in the set of the target elements is obtained in the stream.
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of target elements; when the matching element The number of matching elements in the set is equal to the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: match the matches in the set of matching elements in the palette template A number of elements, the second predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements.
  • the second determining unit 33 is configured to: A small ascending or descending order, determining a value of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
  • the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the first type of element in the target palette and its in the palette template
  • the second determining unit 33 is further configured to: adjust a value of the at least one first type element in the set of the target elements according to the second predicted difference information.
  • the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether there is a set of the first type element in the target palette according to the prediction information and the matching element. And ok.
  • the decoder 40 shown in FIG. 4 further includes a first preset unit 35, configured to preset the color before determining the set of matching elements in the palette template according to the prediction information. Board template.
  • the decoder 50 shown in FIG. 5 further includes: a first updating unit 36, configured to determine, according to the prediction information and the set of matching elements, the set of the target elements, according to the target element Updating the palette template by the target element in the collection and a counter value corresponding to the matching element in the palette template.
  • a first updating unit 36 configured to determine, according to the prediction information and the set of matching elements, the set of the target elements, according to the target element Updating the palette template by the target element in the collection and a counter value corresponding to the matching element in the palette template.
  • the first updating unit 36 is specifically configured to: update, by using the at least one second type element in the target color palette, a set of the non-matching elements in the palette template;
  • the target element in the swatch updates a counter value corresponding to the element in the palette template.
  • Embodiments of the present invention predictively encode a target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
  • 6 to 8 illustrate coding of a coding method of a target image block implementing an embodiment of the present invention.
  • the encoder 60 includes a construction unit 61, a pre-processing unit 62, and an encoding unit 63. among them:
  • the construction unit 61 is configured to construct a target palette, wherein the target palette is a target element a set of the target elements, wherein each of the target elements is a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one a class of elements and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, the second class element not being based on a match in the palette template The target element determined by the element;
  • the pre-processing unit 62 is configured to determine prediction information of the target palette constructed by the construction unit 61, and predictively encode the target palette according to the prediction information, so as to determine the target palette.
  • a set of matching elements of the at least one first class element in the palette template wherein the palette template is composed of a set of matching elements and/or a set of non-matching elements, the matching elements
  • the set includes at least one matching element, the matching element is an element for matching the first type of element, and an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value, the non-matching
  • the set of elements includes at least one non-matching element, the non-matching element being an element that cannot match the first type of element;
  • the encoding unit 63 is configured to encode the target image block according to the set of the target elements in the target palette that is predicted by the pre-processing unit 62 and the index table.
  • the prediction information includes an element prediction identifier, where the element prediction identifier is a prediction identifier of the palette template, where the prediction identifier of the palette template is used to indicate the a set of matching elements and a set of the non-matching elements; or the element prediction identifier is a predicted identifier of an element in the palette template, wherein a predicted identifier of an element in the palette template is used to indicate the tone
  • the element in the swatch template is a matching element or a non-matching element; or the element predictive identifier is a predicted identifier of the target palette, wherein the predicted identifier of the target palette is used to indicate the target element a first type of element and/or a second type of element in the set; or the element predictive identifier is a predicted identifier of the element in the target palette, wherein the predicted identifier of the target element in the target palette is used to indicate The target element is a first type element or a second type element; or the element prediction identifier is the one of
  • the prediction information may further include first predicted location information, where the first predicted location information is used to indicate that the first class element corresponding to the set of matching elements respectively is in the target element
  • the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of the target elements.
  • the prediction information may further include first index information, where the first index information is used to indicate a corresponding position of all matching elements in the set of matching elements in the palette template; or the prediction information is further The second index information is included, wherein the second index information is used to indicate a corresponding position of the matching element in the palette template.
  • the prediction information may further include first predicted difference information, wherein the first predicted difference information is used to indicate that each of the at least one first type of elements in the target palette is a difference value of the matching elements in the palette template; or the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the number in the target palette The difference between a class of elements and their matching elements in the palette template.
  • the prediction information may further include prediction indication information, where the prediction indication information is used to indicate whether one of the first class elements in the target palette is determined according to the prediction information and the set of matching elements. .
  • the encoder 70 shown in Fig. 7 further includes a second preset unit 64 for presetting the palette template before the prediction information of the target palette is determined.
  • the encoder 80 shown in FIG. 8 further includes a second updating unit 65, configured to: according to the target in the set of target elements after the predictive encoding of the target palette according to the prediction information
  • the palette template is updated by an element and a counter value corresponding to the matching element in the palette template.
  • the second updating unit 65 is specifically configured to: update, by using the at least one second class element in the target color palette, a set of the non-matching elements in the palette template;
  • the target element in the swatch updates a counter value corresponding to the element in the palette template.
  • Embodiments of the present invention predictively encode a target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as the units may or may not be physical units, that is, may be located at one place, or may be distributed to a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, or the part contributing to the prior art or the part of the technical solution, may be embodied in the form of a software product stored in a
  • the storage medium includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Provided in an embodiment of the present invention are a target image block decoding and encoding method, and a decoder and encoder. The decoding method comprises: obtaining predictive information of a target color palette from the received data rate of the target image block; determining the set of matching elements in the color palette template according to the predictive information; determining the set of target elements according to the predictive information and the set of the matching elements; and decoding the target image block according to the set of the target elements. The embodiment of the present invention predictively encodes the target color palette using for example the predictive information to reduce encoding overhead of the target color palette, thus improving compression efficiency of video images employing the multi-stage BCIM-based scheme.

Description

目标图像块的解码方法和编码方法以及解码器和编码器 技术领域  Decoding method and encoding method of target image block, and decoder and encoder
本发明涉及视频编解码领域, 特别地, 涉及目标图像块的解码方法和 解码器以及目标图像块的编码方法及编码器。 背景技术  The present invention relates to the field of video coding and decoding, and in particular, to a decoding method and a decoder of a target image block, and an encoding method and an encoder of the target image block. Background technique
随着互联网的迅猛发展以及人们物质精神文化的日益丰富,在互联网 中针对视频的应用需求尤其是针对高清视频的应用需求越来越多,而高清 视频的数据量非常大,要想高清视频能在带宽有限的互联网中传输, 必须 首先解决的问题就是高清视频压缩编码问题。  With the rapid development of the Internet and the increasing material and spiritual culture of people, the demand for video applications in the Internet, especially for high-definition video applications, is increasing, and the amount of high-definition video is very large. The problem that must be solved first in the transmission of limited bandwidth Internet is the high-definition video compression coding problem.
已有的视频编码标准技术可以有效地压缩编码自然图像序列,但不完 全适用于屏幕内容序列。 与自然内容相比较, 屏幕内容中包含的文字和表 格的边缘相对比较锐利、 形状不规则, 导致空间相关性减弱, 预测、 变换 不能有效地去除冗余信息, 不能达到很好的压缩编码效果。  Existing video coding standard techniques can effectively compress encoded natural image sequences, but are not fully applicable to screen content sequences. Compared with the natural content, the edges of the text and the table contained in the screen content are relatively sharp and irregular in shape, resulting in weak spatial correlation. The prediction and transformation cannot effectively remove redundant information, and can not achieve a good compression coding effect.
调色板编码模式 (Mu l t i -S ta ge BC IM- Ba s ed Scheme ) 利用屏幕图像 信号分布稀疏的特性, 选用几种信号来代表一定区域的图像信息, 从而可 根据失真最小的原则比较调色板编码模式与其它可选编码模式,从中为图 像块选择较优的编码模式。  The palette encoding mode (Mu lti -S ta ge BC IM- Ba s ed Scheme ) uses the characteristics of the sparse distribution of the screen image signal, and selects several signals to represent the image information of a certain area, so that the tone can be compared according to the principle of minimum distortion. The swatch encoding mode and other optional encoding modes are used to select a better encoding mode for the image block.
但是,现有的调色板编码模式需要对每个信号分量的每个图像块的调 色板进行单独编码, 没有考虑到空间以及时间上的相关性, 不能有效地的 去除调色板冗余信息。 实验测试表明, 编码调色板所需的比特数占总码流 的 1 0%左右, 占了相对较大的比重, 严重影响调色板编码模式所能达到的 编码效果。 发明内容  However, the existing palette coding mode requires separate coding of the palette of each image block of each signal component, without considering the spatial and temporal correlation, and cannot effectively remove the palette redundancy. information. Experimental tests show that the number of bits required to encode the palette accounts for about 10% of the total code stream, which accounts for a relatively large proportion, which seriously affects the coding effect that the palette coding mode can achieve. Summary of the invention
本发明提出了目标图像块的解码方法和编码方法以及解码器和编码 器, 旨在解决现有的釆用调色板编码模式的视频图像的压缩效率低的问 题。 The invention provides a decoding method and an encoding method of a target image block, and a decoder and encoding The aim of the present invention is to solve the problem of low compression efficiency of video images in the existing palette coding mode.
第一方面, 提出了一种目标图像块的解码方法, 包括: 从接收到的目 标图像块的码流中获取目标调色板的预测信息,其中所述目标图像块是釆 用调色板编码模式的图像块, 所述目标调色板是目标元素的集合, 所述目 标元素的集合中的每个目标元素是基于所述目标图像块的一个信号分量 的釆样点数值确定的具有代表性的数值,其中所述目标元素的集合包括至 少一个第一类元素和 /或至少一个第二类元素, 所述第一类元素是需要根 据调色板模板中的匹配元素确定的目标元素,所述第二类元素无需根据调 色板模板中的匹配元素确定的目标元素; 根据所述预测信息, 确定在所述 调色板模板中的匹配元素的集合,其中所述调色板模板由匹配元素的集合 和 /或非匹配元素的集合组成, 所述匹配元素的集合包括至少一个匹配元 素, 所述匹配元素是用于匹配所述第一类元素的元素, 所述第一类元素的 数值与其匹配元素的数值之差的绝对值小于预定值,所述非匹配元素的集 合包括至少一个非匹配元素,所述非匹配元素是无法与所述第一类元素匹 配的元素; 根据所述预测信息与所述匹配元素的集合, 确定所述目标元素 的集合; 依据所述目标元素的集合, 对所述目标图像块进行解码。  In a first aspect, a decoding method of a target image block is provided, including: acquiring prediction information of a target palette from a code stream of a received target image block, wherein the target image block is encoded by a palette a mode image block, the target palette is a set of target elements, each target element in the set of target elements being representative based on a sample point value of a signal component of the target image block a value, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, The second type of element does not need to be determined according to the matching element in the palette template; according to the prediction information, a set of matching elements in the palette template is determined, wherein the palette template is matched by a collection of elements and/or a collection of non-matching elements, the set of matching elements comprising at least one matching element, the matching element being used Matching an element of the first type of element, an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value, the set of the non-matching element includes at least one non-matching element, the non-matching An element is an element that cannot match the first type of element; determining, according to the prediction information and the set of the matching elements, a set of the target elements; and performing, according to the set of the target elements, the target image block decoding.
结合第一方面, 在第一方面的第一实施方式中, 所述预测信息包括元 素预测标识; 所述根据所述预测信息, 确定在所述调色板模板中的匹配元 素的集合, 包括: 根据所述元素预测标识, 确定在所述调色板模板中的匹 配元素的集合。  With reference to the first aspect, in the first implementation manner of the first aspect, the prediction information includes an element prediction identifier, and determining, according to the prediction information, a set of matching elements in the palette template, including: A set of matching elements in the palette template is determined based on the element prediction identifier.
结合第一方面的第一实施方式, 在第一方面的第二实施方式中, 所述 根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的集合, 包 括: 当所述元素预测标识为所述调色板模板的预测标识, 根据所述调色板 模板的预测标识确定在所述调色板模板中的匹配元素的集合,其中所述调 色板模板的预测标识用于指示所述调色板模板中的所述匹配元素的集合 与所述非匹配元素的集合。  With reference to the first embodiment of the first aspect, in the second implementation manner of the first aspect, the determining, according to the element prediction identifier, the set of matching elements in the palette template, includes: The element prediction identifier is a predicted identifier of the palette template, and a set of matching elements in the palette template is determined according to the predicted identifier of the palette template, wherein the prediction identifier of the palette template is used And indicating a set of the matching elements in the palette template and a set of the non-matching elements.
结合第一方面的第二实施方式, 在第一方面的第三实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第一预测位置信息, 所述 第一预测位置信息用于指示所述匹配元素的集合分别对应的第一类元素 在所述目标元素的集合中的位置;当所述匹配元素的集合中匹配元素的个 数少于所述目标元素的集合中目标元素的个数,所述根据所述预测信息与 所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板 模板的预测标识、 所述第一预测位置信息和所述匹配元素的集合, 确定所 述目标元素的集合中的所述至少一个第一类元素的数值及其位置;从所述 目标图像块的码流中获取所述目标元素的集合中的所述至少一个第二类 元素的数值。 With reference to the second embodiment of the first aspect, in a third implementation manner of the first aspect, when the set of matching elements is non-empty, the prediction information further includes first predicted location information, The first predicted location information is used to indicate a location of the first type of elements corresponding to the set of matching elements in the set of the target elements; when the number of matching elements in the set of matching elements is less than the target a number of the target elements in the set of the elements, the determining the set of the target elements according to the prediction information and the set of the matching elements, including: according to the prediction identifier of the palette template, the first Predicting location information and the set of matching elements, determining a value of the at least one first class element in the set of target elements and a location thereof; obtaining the target element from a code stream of the target image block The value of the at least one second type element in the collection.
结合第一方面的第二实施方式, 在第一方面的第四实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第一预测位置信息, 所述 第一预测位置信息用于指示所述匹配元素的集合分别对应的第一类元素 在所述目标元素的集合中的位置;当所述匹配元素的集合中匹配元素的个 数等于所述目标元素的集合中目标元素的个数,所述根据所述预测信息与 所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述元素预 测标识、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目标元 素的集合中的所述至少一个第一类元素的数值及其位置。  With reference to the second implementation manner of the first aspect, in the fourth implementation manner of the first aspect, when the set of the matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location The information is used to indicate a position of the first type element corresponding to the set of the matching elements in the set of the target elements; when the number of matching elements in the set of the matching elements is equal to the target in the set of the target element Determining the set of the target elements according to the prediction information and the set of matching elements, including: determining, according to the element, the first predicted location information, and the matching element And determining a value of the at least one first class element in the set of the target elements and a location thereof.
结合第一方面的第二实施方式, 在第一方面的第五实施方式中, 当所 述匹配元素的集合为非空,当所述匹配元素的集合中匹配元素的个数少于 或等于所述目标元素的集合中目标元素的个数,所述根据所述预测信息与 所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数值大小的 升序或降序排列, 根据所述元素预测标识和所述匹配元素的集合, 确定所 述目标元素的集合中全部所述目标元素的数值及其位置。  With reference to the second embodiment of the first aspect, in the fifth implementation manner of the first aspect, when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to The number of the target elements in the set of the target elements, the determining the set of the target elements according to the prediction information and the set of the matching elements, including: sorting in ascending or descending order according to a numerical value, according to the element And predicting the identifier and the set of matching elements, determining a value of all of the target elements in the set of the target elements and a location thereof.
结合第一方面的第三、 第四或第五实施方式, 在第一方面的第六实施 方式中, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值 信息用于指示所述目标调色板中所述至少一个第一类元素中每个第一类 元素与其在所述调色板模板中的匹配元素的差值;所述根据所述预测信息 与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述第一 预测差值信息,调整所述目标元素的集合中的所述至少一个第一类元素的 数值。 结合第一方面的第一实施方式, 在第一方面的第七实施方式中, 所述 根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的集合, 包 括: 当所述元素预测标识为所述调色板模板中元素的预测标识,依次根据 所述调色板模板中元素的预测标识确定在所述调色板模板中的匹配元素, 所确定的全部的所述匹配元素构成所述匹配元素的集合,其中所述调色板 模板中元素的预测标识用于指示所述调色板模板中所述元素为匹配元素 或非匹配元素。 With reference to the third, fourth or fifth embodiment of the first aspect, in the sixth implementation manner of the first aspect, the prediction information further includes first predicted difference information, wherein the first predicted difference information is used And indicating a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the according to the prediction information and the And determining, by the set of the matching elements, the set of the target elements, including: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements. With reference to the first embodiment of the first aspect, in a seventh implementation manner of the first aspect, the determining, according to the element prediction identifier, a set of matching elements in the palette template, including: The element prediction identifier is a predicted identifier of the element in the palette template, and the matching element in the palette template is determined according to the predicted identifier of the element in the palette template, and all the matched matches are determined. The elements constitute a set of the matching elements, wherein the predicted identification of the elements in the palette template is used to indicate that the elements in the palette template are matching elements or non-matching elements.
结合第一方面的第七实施方式, 在第一方面的第八实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第二预测位置信息, 所述 第二预测位置信息用于指示所述匹配元素对应的第一类元素在所述目标 元素的集合中的位置;当所述匹配元素的集合中匹配元素的个数少于所述 目标元素的集合中目标元素的个数,所述根据所述预测信息与所述匹配元 素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板模板中元素 的预测标识、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目 标元素的集合中的所述至少一个第一类元素的数值和位置;从所述目标图 像块的码流中获取所述目标元素的集合中的所述至少一个第二类元素的 数值。  With reference to the seventh embodiment of the first aspect, in the eighth implementation manner of the first aspect, when the set of the matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of matching elements is less than the target element in the set of the target element Determining, according to the prediction information and the set of matching elements, determining the set of the target elements, including: according to the prediction identifier of the element in the palette template, the second predicted location information, and Determining a set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; obtaining the at least the set of the target elements from a code stream of the target image block The value of a second type of element.
结合第一方面的第七实施方式, 在第一方面的第九实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第二预测位置信息, 所述 第二预测位置信息用于指示所述匹配元素对应的第一类元素在所述目标 元素的集合中的位置;当所述匹配元素的集合中匹配元素的个数等于所述 目标元素的集合中目标元素的个数,所述根据所述预测信息与所述匹配元 素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板模板中元素 的预测标识、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目 标元素的集合中的所述至少一个第一类元素的数值和位置。  With reference to the seventh embodiment of the first aspect, in a ninth implementation manner of the first aspect, when the set of matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of the matching element is equal to the target element in the set of the target element And determining, according to the prediction information and the set of matching elements, the set of the target elements, including: according to the predicted identifier of the element in the palette template, the second predicted location information, and the A set of matching elements, determining a value and a location of the at least one first type of element in the set of target elements.
结合第一方面的第七实施方式, 在第一方面的第十实施方式中, 当所 述匹配元素的集合为非空,当所述匹配元素的集合中匹配元素的个数少于 或等于所述目标元素的集合中目标元素的个数,所述根据所述预测信息与 所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数值大小的 升序或降序排列, 根据所述元素预测标识和所述匹配元素的集合, 确定所 述目标元素的集合中全部目标元素的数值及其位置。 With reference to the seventh embodiment of the first aspect, in the tenth implementation manner of the first aspect, when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to a number of the target elements in the set of the target elements, the determining the set of the target elements according to the prediction information and the set of the matching elements, including: according to a numerical value Sorting in ascending or descending order, determining a value of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
结合第一方面的第八、 第九或第十实施方式, 在第一方面的第十一实 施方式中, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差 值信息用于指示所述目标调色板中所述第一类元素与其在所述调色板模 板中的匹配元素的差值; 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述第二预测差值信息, 调整所述 目标元素的集合中的所述至少一个第一类元素的数值。  With reference to the eighth, ninth or tenth embodiment of the first aspect, in the eleventh implementation of the first aspect, the prediction information further includes second predicted difference information, wherein the second predicted difference information Determining a difference between the first type of elements in the target palette and matching elements in the palette template; determining, according to the prediction information and the set of matching elements, And the set of the target elements includes: adjusting, according to the second predicted difference information, a value of the at least one first type element in the set of the target elements.
结合第一方面的第一实施方式, 在第一方面的第十二实施方式中, 所 述预测信息还包括第一索引信息,其中所述第一索引信息用于指示所述匹 配元素的集合中全部匹配元素在所述调色板模板中的对应位置;所述根据 所述元素预测标识, 确定在所述调色板模板中的匹配元素的集合, 包括: 当所述元素预测标识为所述目标调色板的预测标识,且所述目标调色板的 预测标识指示所述目标调色板中的所述至少一个第一类元素,确定所述调 色板模板中由所述第一索引信息指示的对应位置的全部匹配元素构成在 所述调色板模板中的匹配元素的集合。  With reference to the first embodiment of the first aspect, in the twelfth implementation of the first aspect, the prediction information further includes first index information, where the first index information is used to indicate the set of matching elements a corresponding position of all matching elements in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is the a predicted identifier of the target palette, and the predicted identifier of the target palette indicates the at least one first type element in the target palette, and the first index is determined in the palette template All matching elements of the corresponding locations indicated by the information constitute a set of matching elements in the palette template.
结合第一方面的第十二实施方式, 在第一方面的第十三实施方式中, 当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中目 标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述 目标元素的集合, 包括: 根据所述目标调色板的预测标识、 所述第一索引 信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个 第一类元素的数值和位置;从所述目标图像块的码流中获取所述目标元素 的集合中的所述至少一个第二类元素的数值。  With reference to the twelfth embodiment of the first aspect, in the thirteenth implementation of the first aspect, the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements Determining, according to the prediction information and the set of matching elements, the set of the target elements, including: a prediction identifier according to the target palette, the first index information, and a set of the matching elements Determining a value and a location of the at least one first class element in the set of target elements; obtaining the at least one second class element in the set of the target elements from a code stream of the target image block The value.
结合第一方面的第十二实施方式, 在第一方面的第十四实施方式中, 当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中目 标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述 目标元素的集合, 包括: 根据所述目标调色板的预测标识、 所述第一索引 信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个 第一类元素的数值和位置。 结合第一方面的第十二实施方式, 在第一方面的第十五实施方式中, 当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的集 合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确 定所述目标元素的集合, 包括: 按照数值大小的升序或降序排列, 根据所 述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合中全部 目标元素的数值及其位置。 With reference to the twelfth embodiment of the first aspect, in the fourteenth embodiment of the first aspect, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, Determining, according to the prediction information and the set of matching elements, the set of the target elements, including: according to the prediction identifier of the target palette, the first index information, and the set of matching elements, Determining a value and a location of the at least one first class element in the set of target elements. With reference to the twelfth embodiment of the first aspect, in the fifteenth implementation of the first aspect, the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements Determining, according to the prediction information and the set of matching elements, determining the set of the target elements, including: arranging in ascending or descending order according to a numerical value, and predicting an identifier according to the element and a set of the matching elements And determining a value of all target elements in the set of the target elements and their positions.
结合第一方面的第十三、 第十四或第十五实施方式, 在第一方面的第 十六实施方式中, 所述预测信息还包括第一预测差值信息, 其中所述第一 预测差值信息用于指示所述目标调色板中所述至少一个第一类元素中每 个第一类元素与其在所述调色板模板中的匹配元素的差值;所述根据所述 目标调色板的预测标识、 所述第一索引信息和所述匹配元素的集合, 确定 所述目标元素的集合中的所述至少一个第一类元素, 包括: 根据所述第一 预测差值信息,调整所述目标元素的集合中的所述至少一个第一类元素的 数值。  With reference to the thirteenth, fourteenth or fifteenth embodiment of the first aspect, in the sixteenth implementation of the first aspect, the prediction information further includes first prediction difference information, wherein the first prediction The difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and its matching elements in the palette template; Determining the at least one first class element in the set of the target elements, the prediction identifier of the color palette, the first index information, and the set of matching elements, including: according to the first predicted difference information And adjusting a value of the at least one first type element in the set of the target elements.
结合第一方面的第一实施方式, 在第一方面的第十七实施方式中, 所 述预测信息还包括第二索引信息,其中所述第二索引信息用于指示所述匹 配元素在所述调色板模板中的对应位置; 所述根据所述元素预测标识, 确 定在所述调色板模板中的匹配元素的集合, 包括: 当所述元素预测标识为 所述目标调色板中元素的预测标识,且所述目标调色板中目标元素的预测 标识用于指示所述目标元素为第一类元素,依次确定所述调色板模板中由 所述第二索引信息指示的对应位置的匹配元素,所确定的全部所述匹配元 素构成在所述调色板模板中的所述匹配元素的集合。  With reference to the first embodiment of the first aspect, in the seventeenth implementation of the first aspect, the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the a corresponding position in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is an element in the target palette a prediction identifier, and the prediction identifier of the target element in the target palette is used to indicate that the target element is a first type element, and sequentially determine a corresponding location in the palette template indicated by the second index information Matching elements, all of the determined matching elements constitute a set of the matching elements in the palette template.
结合第一方面的第十七实施方式, 在第一方面的第十八实施方式中, 当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中目 标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述 目标元素的集合, 包括: 根据所述目标调色板中元素的预测标识、 所述第 二索引信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至 少一个第一类元素的数值和位置;从所述目标图像块的码流中获取所述目 标元素的集合中的所述至少一个第二类元素的数值。 结合第一方面的第十七实施方式, 在第一方面的第十九实施方式中, 当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中目 标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述 目标元素的集合, 包括: 根据所述目标调色板中元素的预测标识、 所述第 二索引信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至 少一个第一类元素的数值和位置。 With reference to the seventeenth embodiment of the first aspect, in the eighteenth embodiment of the first aspect, the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements And determining, according to the prediction information and the set of matching elements, the set of the target elements, including: determining, according to the prediction identifier of the element in the target palette, the second index information, and the matching element And a set of values of the at least one first type of elements in the set of target elements; obtaining the at least one of the set of target elements from a code stream of the target image block The value of the class element. With reference to the seventeenth embodiment of the first aspect, in the nineteenth implementation of the first aspect, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, Determining, according to the prediction information and the set of matching elements, the set of the target elements, including: according to a prediction identifier of an element in the target palette, the second index information, and the matching element And determining a value and a location of the at least one first class element in the set of the target elements.
结合第一方面的第十七实施方式, 在第一方面的第二十实施方式中, 当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的集 合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确 定所述目标元素的集合, 包括: 按照数值大小的升序或降序排列, 根据所 述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合中全部 目标元素的数值及其位置。  With reference to the seventeenth embodiment of the first aspect, in the twentieth embodiment of the first aspect, when the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements Determining, according to the prediction information and the set of matching elements, determining the set of the target elements, including: arranging in ascending or descending order according to a numerical value, and predicting an identifier according to the element and a set of the matching elements And determining a value of all target elements in the set of the target elements and their positions.
结合第一方面的第十八、 第十九或第二十实施方式, 在第一方面的第 二十一实施方式中, 所述预测信息还包括第二预测差值信息, 其中所述第 二预测差值信息用于指示所述目标调色板中所述第一类元素与其在所述 调色板模板中的匹配元素的差值;所述根据所述目标调色板中元素的预测 标识、 所述第二索引信息和所述匹配元素的集合, 确定所述目标元素的集 合中的所述至少一个第一类元素, 包括: 根据所述第二预测差值信息, 调 整确定所述目标元素的集合中的所述至少一个第一类元素的数值。  With reference to the eighteenth, nineteenth or twentieth embodiment of the first aspect, in the twenty-first embodiment of the first aspect, the prediction information further includes second predicted difference information, wherein the second The prediction difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template; the prediction identifier according to the elements in the target palette And determining, by the second index information and the set of matching elements, the at least one first type element in the set of the target elements, including: adjusting, determining the target according to the second predicted difference information The value of the at least one first class element in the set of elements.
结合第一方面的第一实施方式, 在第一方面的第二十二实施方式中, 所述预测信息还包括第一索引信息,其中所述第一索引信息用于指示所述 匹配元素的集合中全部匹配元素在所述调色板模板中的对应位置;所述根 据所述元素预测标识,确定在所述调色板模板中的匹配元素的集合,包括: 当所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述匹 配元素的数目, 且所述数目大于或等于 1 , 确定所述调色板模板中由所述 第一索引信息指示的对应位置的全部匹配元素构成所述调色板模板中的 匹配元素的集合,其中所述调色板模板中所述匹配元素的集合中所述匹配 元素的数目用于指示为所述目标调色板能够在所述调色板模板中找到匹 配元素的个数。 结合第一方面的第二十二实施方式,在第一方面的第二十三实施方式 中, 所述预测信息还包括第一预测位置信息, 所述第一预测位置信息用于 指示所述匹配元素的集合分别对应的第一类元素在所述目标元素的集合 中的位置;当所述匹配元素的集合中匹配元素的个数少于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板模板中所述匹配元素的 集合中所述匹配元素的数目、所述第一预测位置信息和所述匹配元素的集 合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和位 置;从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 With reference to the first embodiment of the first aspect, in the twenty-second implementation manner of the first aspect, the prediction information further includes first index information, wherein the first index information is used to indicate a set of the matching elements a corresponding position of all matching elements in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is Determining, in the palette template, the number of the matching elements in the set of matching elements, and the number is greater than or equal to 1, determining all the corresponding positions in the palette template indicated by the first index information Matching elements constitute a set of matching elements in the palette template, wherein the number of matching elements in the set of matching elements in the palette template is used to indicate that the target palette is capable of being Find the number of matching elements in the palette template. With reference to the twenty-second implementation of the first aspect, in the twenty-third implementation of the first aspect, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first class element in the set of target elements; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, Determining the set of the target elements according to the prediction information and the set of matching elements, including: according to the number of the matching elements in the set of matching elements in the palette template, the first Predicting location information and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; obtaining a set of the target elements from a code stream of the target image block The value of the at least one second type element in the medium.
结合第一方面的第二十二实施方式,在第一方面的第二十四实施方式 中, 所述预测信息还包括第一预测位置信息, 所述第一预测位置信息用于 指示所述匹配元素的集合分别对应的第一类元素在所述目标元素的集合 中的位置;当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板模板中所述匹配元素的 集合中所述匹配元素的数目、所述第一预测位置信息和所述匹配元素的集 合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和位 置。  With reference to the twenty-second embodiment of the first aspect, in the twenty-fourth implementation manner of the first aspect, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first type of elements in the set of target elements; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, Determining the set of the target elements according to the prediction information and the set of matching elements, including: according to the number of the matching elements in the set of matching elements in the palette template, the first prediction The location information and the set of matching elements determine a value and a location of the at least one first class element in the set of target elements.
结合第一方面的第二十二实施方式,在第一方面的第二十五实施方式 中,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数值大小的升序或降序排列, 根据 所述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合中全 部目标元素的数值及其位置。  With reference to the twenty-second embodiment of the first aspect, in the twenty-fifth implementation manner of the first aspect, when the number of matching elements in the set of matching elements is less than or equal to the target in the set of the target elements Determining the set of the target elements according to the prediction information and the set of matching elements, including: sorting in ascending or descending order according to a numerical value, and predicting the identifier and the matching element according to the element a collection that determines the values of all of the target elements in the set of target elements and their locations.
结合第一方面的第二十三、 第二十四或第二十五实施方式, 在第一方 面的第二十六实施方式中, 所述预测信息还包括第一预测差值信息, 其中 所述第一预测差值信息用于指示所述目标调色板中所述至少一个第一类 元素中每个第一类元素与其在所述调色板模板中的匹配元素的差值;所述 根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、所述 第一预测位置信息和所述匹配元素的集合,确定所述目标元素的集合中的 所述至少一个第一类元素, 包括: 根据所述第一预测差值信息, 调整所述 目标元素的集合中的所述至少一个第一类元素的数值。 With reference to the twenty-third, twenty-fourth or twenty-fifth implementation manner of the first aspect, in the twenty-sixth implementation manner of the first aspect, the prediction information further includes first prediction difference information, where The first predicted difference value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; Determining the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements The first type of element includes: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
结合第一方面的第一实施方式, 在第一方面的第二十七实施方式中, 所述预测信息还包括第二索引信息,其中所述第二索引信息用于指示所述 匹配元素在所述调色板模板中的对应位置; 所述根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的集合, 包括: 当所述元素预测标识 为所述调色板模板中所述匹配元素的集合中所述匹配元素的数目,且所述 数目大于或等于 1 , 依次确定所述调色板模板中由所述第二索引信息指示 的对应位置的匹配元素,所确定的全部所述匹配元素构成所述调色板模板 中的匹配元素的集合 ,其中所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目用于指示为所述目标调色板能够在所述调色板模板中找 到匹配元素的个数。  With reference to the first embodiment of the first aspect, in the twenty-seventh implementation of the first aspect, the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the a corresponding position in the palette template; determining, according to the element prediction identifier, a set of matching elements in the palette template, including: when the element prediction identifier is in the palette template a number of the matching elements in the set of matching elements, and the number is greater than or equal to 1, and determining, in sequence, matching elements of corresponding positions indicated by the second index information in the palette template, determined All of the matching elements constitute a set of matching elements in the palette template, wherein the number of the matching elements in the set of matching elements in the palette template is used to indicate the target palette The number of matching elements can be found in the palette template.
结合第一方面的第二十七实施方式,在第一方面的第二十八实施方式 中, 所述预测信息还包括第二预测位置信息, 所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置;当 所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中目标 元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目 标元素的集合, 包括: 根据所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目、 所述第二预测位置信息和所述匹配元素的集合, 确定所 述目标元素的集合中的所述至少一个第一类元素的数值和位置;从所述目 标图像块的码流中获取所述目标元素的集合中的所述至少一个第二类元 素的数值。  In conjunction with the twenty-seventh implementation of the first aspect, in the twenty-eighth implementation manner of the first aspect, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of the matching element is less than the number of the target elements in the set of the target element, the basis Determining, by the set of the prediction information, the set of the matching elements, determining the set of the target elements, including: according to the number of the matching elements in the set of the matching elements in the palette template, the second predicted location information And determining, by the set of the matching elements, a value and a location of the at least one first class element in the set of the target elements; acquiring a location in the set of the target elements from a code stream of the target image block The value of at least one second type of element.
结合第一方面的第二十七实施方式,在第一方面的第二十九实施方式 中, 所述预测信息还包括第二预测位置信息, 所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置;当 所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中目标 元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目 标元素的集合, 包括: 根据所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目、 所述第二预测位置信息和所述匹配元素的集合, 确定所 述目标元素的集合中的所述至少一个第一类元素的数值和位置。 In conjunction with the twenty-seventh implementation of the first aspect, in the twenty-ninth implementation manner of the first aspect, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target element, according to the Predicting information and a set of matching elements to determine the target The set of the target elements includes: determining, according to the number of the matched elements in the set of matching elements in the palette template, the second predicted position information, and the set of the matching elements, determining the target element The value and location of the at least one first class element in the collection.
结合第一方面的第二十七实施方式, 在第一方面的第三十实施方式 中,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数值大小的升序或降序排列, 根据 所述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合中全 部目标元素的数值及其位置。  With reference to the twenty-seventh embodiment of the first aspect, in the thirtieth embodiment of the first aspect, when the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements Determining the set of the target elements according to the prediction information and the set of matching elements, including: sorting in ascending or descending order according to a numerical value, and predicting the identifier and the matching element according to the element A set that determines the values of all of the target elements in the set of target elements and their locations.
结合第一方面的第二十八、 第二十九或第三十实施方式, 在第一方面 的第三十一实施方式中, 所述预测信息还包括第二预测差值信息, 其中所 述第二预测差值信息用于指示所述目标调色板中所述第一类元素与其在 所述调色板模板中的匹配元素的差值;所述根据所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目、所述第二预测位置信息和所述匹配 元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素, 包 括: 根据所述第二预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。  With reference to the twenty-eighth, twenty-ninth or thirtieth embodiment of the first aspect, in the thirty-first embodiment of the first aspect, the prediction information further includes second predicted difference information, wherein The second predicted difference information is used to indicate a difference between the first type of elements in the target palette and matching elements in the palette template; the according to the palette template Determining the number of the matching elements in the set of matching elements, the second predicted location information, and the set of matching elements, determining the at least one first class element in the set of the target elements, including: according to the The second predicted difference information adjusts a value of the at least one first type element in the set of the target elements.
结合第一方面的第一至第三十一实施方式,在第一方面的第三十二实 施方式中, 所述预测信息还包括预测指示信息, 所述预测指示信息用于指 示所述目标调色板中是否存在一个所述第一类元素能够根据所述预测信 息与所述匹配元素的集合而确定。  With reference to the first to thirty-first embodiments of the first aspect, in the thirty-second implementation manner of the first aspect, the prediction information further includes prediction indication information, where the prediction indication information is used to indicate the target adjustment Whether or not one of the first type elements exists in the swatch can be determined according to the prediction information and the set of matching elements.
结合第一方面及其各个实施方式, 在第一方面的第三十三实施方式 中, 在所述根据所述预测信息, 确定在所述调色板模板中的匹配元素的集 合之前, 还包括: 预设所述调色板模板。  With reference to the first aspect and various embodiments thereof, in the thirty-third implementation manner of the first aspect, before the determining, according to the prediction information, the set of matching elements in the palette template, : Preset the palette template.
结合第一方面及其各个实施方式, 在第一方面的第三十四实施方式 中, 在所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素 的集合之后, 还包括: 根据所述目标元素的集合中的所述目标元素以及所 述调色板模板中的所述匹配元素对应的计数器数值, 更新所述调色板模 板。 结合第一方面的第三十四实施方式,在第一方面的第三十五实施方式 中, 所述更新所述调色板模板包括: 利用所述目标调色板中的所述至少一 个第二类元素, 更新所述调色板模板中所述非匹配元素的集合; 利用所述 目标调色板中的所述目标元素,分别更新所述调色板模板中与元素对应的 计数器数值。 With reference to the first aspect and the various embodiments thereof, in the thirty-fourth implementation manner of the first aspect, after the determining the set of the target elements according to the prediction information and the set of matching elements, : updating the palette template according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template. In conjunction with the thirty-fourth implementation of the first aspect, in the thirty-fifth implementation of the first aspect, the updating the palette template comprises: utilizing the at least one of the target palettes a second type of element, updating a set of the non-matching elements in the palette template; and using the target element in the target palette, respectively updating a counter value corresponding to the element in the palette template.
第二方面, 提出了一种目标图像块的编码方法, 包括: 构造目标调色 板, 其中所述目标调色板是目标元素的集合, 所述目标元素的集合中的每 个目标元素是基于所述目标图像块的一个信号分量的釆样点数值确定的 具有代表性的数值,其中所述目标元素的集合包括至少一个第一类元素和 /或至少一个第二类元素, 所述第一类元素是需要根据调色板模板中的匹 配元素确定的目标元素,所述第二类元素无需根据调色板模板中的匹配元 素确定的目标元素; 确定所述目标调色板的预测信息, 并根据所述预测信 息对所述目标调色板进行预测编码,以便确定所述目标调色板中的所述至 少一个第一类元素在所述调色板模板中的匹配元素的集合,其中所述调色 板模板由匹配元素的集合和 /或非匹配元素的集合组成, 所述匹配元素的 集合包括至少一个匹配元素,所述匹配元素是用于匹配所述第一类元素的 元素,所述第一类元素的数值与其匹配元素的数值之差的绝对值小于预定 值, 所述非匹配元素的集合包括至少一个非匹配元素, 所述非匹配元素是 无法与所述第一类元素匹配的元素;根据所述预测编码的目标调色板中所 述目标元素的集合以及索引表, 对所述目标图像块进行编码。  In a second aspect, a coding method of a target image block is provided, comprising: constructing a target color palette, wherein the target color image is a set of target elements, each target element in the set of the target element is based on a representative value determined by a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first The class element is a target element that needs to be determined according to a matching element in the palette template, the second type element does not need a target element determined according to the matching element in the palette template; determining prediction information of the target color palette, And predictively encoding the target color palette according to the prediction information, so as to determine a set of matching elements of the at least one first type element in the target palette in the palette template, where The palette template is composed of a set of matching elements and/or a set of non-matching elements, the set of matching elements including at least one matching element The matching element is an element for matching the first type of element, the absolute value of the difference between the value of the first type element and the value of the matching element is less than a predetermined value, and the set of the non-matching element includes at least a non-matching element, the non-matching element being an element that cannot match the first type of element; a set of the target element in the target palette according to the predictive encoding and an index table, the target image block Encode.
结合第二方面, 在第二方面的第一实施方式中, 所述预测信息包括元 素预测标识, 所述元素预测标识为所述调色板模板的预测标识, 其中所述 调色板模板的预测标识用于指示所述调色板模板中的所述匹配元素的集 合与所述非匹配元素的集合;或者所述元素预测标识为所述调色板模板中 元素的预测标识,其中所述调色板模板中元素的预测标识用于指示所述调 色板模板中所述元素为匹配元素或非匹配元素;或者所述元素预测标识为 所述目标调色板的预测标识,其中所述目标调色板的预测标识用于指示所 述目标元素的集合中的第一类元素和 /或第二类元素; 或者所述元素预测 标识为所述目标调色板中元素的预测标识,其中所述目标调色板中目标元 素的预测标识用于指示所述目标元素为第一类元素或第二类元素;或者所 述元素预测标识为所述调色板模板中所述匹配元素的集合中所述匹配元 素的数目,用于指示为所述目标调色板能够在所述调色板模板中找到匹配 元素的个数。 With reference to the second aspect, in a first implementation manner of the second aspect, the prediction information includes an element prediction identifier, where the element prediction identifier is a prediction identifier of the palette template, where the palette template is predicted Identifying a set of the matching elements in the palette template and a set of the non-matching elements; or the element prediction identifier is a predicted identifier of an element in the palette template, wherein the The predicted identifier of the element in the swatch template is used to indicate that the element in the palette template is a matching element or a non-matching element; or the element prediction identifier is a predicted identifier of the target palette, wherein the target a prediction identifier of the palette for indicating a first type element and/or a second type element in the set of the target elements; or the element prediction And a predicted identifier of the element in the target palette, wherein the predicted identifier of the target element in the target palette is used to indicate that the target element is a first type element or a second type element; or the element prediction The number of the matching elements in the set of matching elements in the palette template is used to indicate the number of matching elements that can be found in the palette template for the target palette.
结合第二方面的第一实施方式, 在第二方面的第二实施方式中, 所述 预测信息还包括第一预测位置信息,所述第一预测位置信息用于指示所述 匹配元素的集合分别对应的第一类元素在所述目标元素的集合中的位置; 或者所述预测信息还包括第二预测位置信息,所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置。  With reference to the first embodiment of the second aspect, in the second implementation manner of the second aspect, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the set of matching elements are respectively a location of the corresponding first type of element in the set of the target element; or the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a first type of element corresponding to the matching element The position in the set of target elements.
结合第二方面的第一或第二实施方式, 在第二方面的第三实施方式 中, 所述预测信息还包括第一索引信息, 其中所述第一索引信息用于指示 所述匹配元素的集合中全部匹配元素在所述调色板模板中的对应位置;或 者所述预测信息还包括第二索引信息,其中所述第二索引信息用于指示所 述匹配元素在所述调色板模板中的对应位置。  With reference to the first or second implementation manner of the second aspect, in the third implementation manner of the second aspect, the prediction information further includes first index information, where the first index information is used to indicate the matching element a corresponding position of all matching elements in the set in the palette template; or the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the palette template The corresponding position in .
结合第二方面的第一至第三实施方式, 在第二方面的第四实施方式 中, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息 用于指示所述目标调色板中所述至少一个第一类元素中每个第一类元素 与其在所述调色板模板中的匹配元素的差值;或者所述预测信息还包括第 二预测差值信息,其中所述第二预测差值信息用于指示所述目标调色板中 所述第一类元素与其在所述调色板模板中的匹配元素的差值。  With reference to the first to third embodiments of the second aspect, in the fourth implementation manner of the second aspect, the prediction information further includes first predicted difference information, where the first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; or the prediction information further includes second predicted difference information And wherein the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template.
结合第二方面的第一至第四实施方式, 在第二方面的第五实施方式 中, 所述预测信息还包括预测指示信息, 所述预测指示信息用于指示所述 目标调色板中是否存在一个所述第一类元素能够根据所述预测信息与所 述匹配元素的集合而确定。  With reference to the first to fourth embodiments of the second aspect, in a fifth implementation manner of the second aspect, the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether the target color palette is There is one of the first type of elements that can be determined based on the prediction information and the set of matching elements.
结合第二方面及其各个实施方式, 在第二方面的第六实施方式中, 在 所述确定所述目标调色板的预测信息之前,还包括:预设所述调色板模板。  In conjunction with the second aspect and various embodiments thereof, in the sixth implementation manner of the second aspect, before the determining the prediction information of the target color palette, the method further includes: preset the color palette template.
结合第二方面及其各个实施方式, 在第二方面的第七实施方式中, 在 所述根据所述预测信息对所述目标调色板进行预测编码之后, 还包括: 根 据所述目标元素的集合中的所述目标元素以及所述调色板模板中的所述 匹配元素对应的计数器数值, 更新所述调色板模板。 With reference to the second aspect and various embodiments thereof, in the seventh implementation manner of the second aspect, after the predictive coding of the target color palette according to the prediction information, the method further includes: The palette template is updated according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template.
结合第二方面的第七实施方式, 在第二方面的第八实施方式中, 所述 更新所述调色板模板包括:利用所述目标调色板中的所述至少一个第二类 元素, 更新所述调色板模板中所述非匹配元素的集合; 利用所述目标调色 板中的所述目标元素, 更新所述调色板模板中与元素对应的计数器数值。  With reference to the seventh embodiment of the second aspect, in the eighth implementation manner of the second aspect, the updating the palette template comprises: using the at least one second type element in the target palette, Updating a set of the non-matching elements in the palette template; updating the counter value corresponding to the element in the palette template by using the target element in the target palette.
第三方面, 提出了一种解码器, 包括: 接收单元, 用于从接收到的目 标图像块的码流中获取目标调色板的预测信息,其中所述目标图像块是釆 用调色板编码模式的图像块, 所述目标调色板是目标元素的集合, 所述目 标元素的集合中的每个目标元素是基于所述目标图像块的一个信号分量 的釆样点数值确定的具有代表性的数值,其中所述目标元素的集合包括至 少一个第一类元素和 /或至少一个第二类元素, 所述第一类元素是需要根 据调色板模板中的匹配元素确定的目标元素,所述第二类元素无需根据调 色板模板中的匹配元素确定的目标元素; 第一确定单元, 用于根据所述接 收单元接收的所述预测信息, 确定在所述调色板模板中的匹配元素的集 合,其中所述调色板模板由匹配元素的集合和 /或非匹配元素的集合组成, 所述匹配元素的集合包括至少一个匹配元素,所述匹配元素是用于匹配所 述第一类元素的元素,所述第一类元素的数值与其匹配元素的数值之差的 绝对值小于预定值, 所述非匹配元素的集合包括至少一个非匹配元素, 所 述非匹配元素是无法与所述第一类元素匹配的元素; 第二确定单元, 用于 根据所述预测信息与所述第一确定单元确定的所述匹配元素的集合,确定 所述目标元素的集合; 解码单元, 用于依据所述第二确定单元确定的所述 目标元素的集合, 对所述目标图像块进行解码。  In a third aspect, a decoder is provided, including: a receiving unit, configured to acquire prediction information of a target palette from a code stream of a received target image block, where the target image block is a color palette An image block of an encoding mode, the target color palette being a set of target elements, each target element in the set of target image elements being representatively determined based on a sample point value of a signal component of the target image block a numerical value, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, The second type of element does not need to be determined according to the matching element in the palette template; the first determining unit is configured to determine, according to the prediction information received by the receiving unit, in the palette template a set of matching elements, wherein the palette template consists of a collection of matching elements and/or a collection of non-matching elements, the collection of matching elements At least one matching element, the matching element is an element for matching the first type of element, and an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value, the non-matching element The set includes at least one non-matching element, the non-matching element is an element that cannot match the first type of element; and a second determining unit, configured to determine the match with the first determining unit according to the prediction information a set of elements, the set of the target elements is determined; a decoding unit, configured to decode the target image block according to the set of the target elements determined by the second determining unit.
结合第三方面, 在第三方面的第一实施方式中, 所述预测信息包括元 素预测标识; 所述第一确定单元用于: 根据所述元素预测标识, 确定在所 述调色板模板中的匹配元素的集合。  With reference to the third aspect, in a first implementation manner of the third aspect, the prediction information includes an element prediction identifier, where the first determining unit is configured to: determine, according to the element prediction identifier, in the palette template A collection of matching elements.
结合第三方面的第一实施方式, 在第三方面的第二实施方式中, 所述 第一确定单元具体用于:当所述元素预测标识为所述调色板模板的预测标 识,根据所述调色板模板的预测标识确定在所述调色板模板中的匹配元素 的集合,其中所述调色板模板的预测标识用于指示所述调色板模板中的所 述匹配元素的集合与所述非匹配元素的集合。 With reference to the first embodiment of the third aspect, in a second implementation manner of the third aspect, the first determining unit is specifically configured to: when the element prediction identifier is a prediction identifier of the palette template, according to the The predictive identity of the palette template determines the matching elements in the palette template And a set of predictions of the palette template for indicating a set of the matching elements in the palette template and a set of the non-matching elements.
结合第三方面的第二实施方式, 在第三方面的第三实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第一预测位置信息, 所述 第一预测位置信息用于指示所述匹配元素的集合分别对应的第一类元素 在所述目标元素的集合中的位置;当所述匹配元素的集合中匹配元素的个 数少于所述目标元素的集合中目标元素的个数,所述第二确定单元具体用 于: 根据所述调色板模板的预测标识、 所述第一预测位置信息和所述匹配 元素的集合,确定所述目标元素的集合中的所述至少一个第一类元素的数 值及其位置;从所述目标图像块的码流中获取所述目标元素的集合中的所 述至少一个第二类元素的数值。  With reference to the second embodiment of the third aspect, in a third implementation manner of the third aspect, when the set of matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location The information is used to indicate a position of the first type element corresponding to the set of the matching elements in the set of the target elements; when the number of matching elements in the set of the matching elements is less than the set of the target elements a number of the target elements, the second determining unit is specifically configured to: determine, according to the prediction identifier of the palette template, the first predicted location information, and the set of matching elements, the set of the target elements a value of the at least one first type of element and its location; obtaining a value of the at least one second type of element in the set of target elements from a code stream of the target image block.
结合第三方面的第二实施方式, 在第三方面的第四实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第一预测位置信息, 所述 第一预测位置信息用于指示所述匹配元素的集合分别对应的第一类元素 在所述目标元素的集合中的位置;当所述匹配元素的集合中匹配元素的个 数等于所述目标元素的集合中目标元素的个数,所述第二确定单元具体用 于: 根据所述元素预测标识、 所述第一预测位置信息和所述匹配元素的集 合,确定所述目标元素的集合中的所述至少一个第一类元素的数值及其位 置。  With reference to the second implementation manner of the third aspect, in the fourth implementation manner of the third aspect, when the set of the matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location The information is used to indicate a position of the first type element corresponding to the set of the matching elements in the set of the target elements; when the number of matching elements in the set of the matching elements is equal to the target in the set of the target element a second determining unit, configured to: determine the at least one of the set of target elements according to the element prediction identifier, the first predicted location information, and the set of matching elements The value of the first type of element and its location.
结合第三方面的第二实施方式, 在第三方面的第五实施方式中, 当所 述匹配元素的集合为非空,当所述匹配元素的集合中匹配元素的个数少于 或等于所述目标元素的集合中目标元素的个数,所述第二确定单元具体用 于: 按照数值大小的升序或降序排列,根据所述元素预测标识和所述匹配 元素的集合,确定所述目标元素的集合中全部所述目标元素的数值及其位 置。  With reference to the second embodiment of the third aspect, in a fifth implementation manner of the third aspect, when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to The number of the target elements in the set of the target elements, the second determining unit is specifically configured to: sort the data according to the numerical value in ascending or descending order, and determine the target element according to the element prediction identifier and the set of the matching elements The values of all the target elements in the collection and their locations.
结合第三方面的第三、 第四或第五实施方式, 在第三方面的第六实施 方式中, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值 信息用于指示所述目标调色板中所述至少一个第一类元素中每个第一类 元素与其在所述调色板模板中的匹配元素的差值;所述第二确定单元还用 于: 根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 With reference to the third, fourth or fifth embodiment of the third aspect, in a sixth implementation manner of the third aspect, the prediction information further includes first predicted difference information, wherein the first predicted difference information is used And indicating a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit further And: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
结合第三方面的第一实施方式, 在第三方面的第七实施方式中, 所述 第一确定单元具体用于:当所述元素预测标识为所述调色板模板中元素的 预测标识,依次根据所述调色板模板中元素的预测标识确定在所述调色板 模板中的匹配元素,所确定的全部的所述匹配元素构成所述匹配元素的集 合,其中所述调色板模板中元素的预测标识用于指示所述调色板模板中所 述元素为匹配元素或非匹配元素。  With reference to the first embodiment of the third aspect, in a seventh implementation manner of the third aspect, the first determining unit is specifically configured to: when the element prediction identifier is a predicted identifier of an element in the palette template, And determining, in sequence, the matching elements in the palette template according to the predicted identifiers of the elements in the palette template, all of the determined matching elements forming a set of the matching elements, wherein the palette template The predicted identifier of the medium element is used to indicate that the element in the palette template is a matching element or a non-matching element.
结合第三方面的第七实施方式, 在第三方面的第八实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第二预测位置信息, 所述 第二预测位置信息用于指示所述匹配元素对应的第一类元素在所述目标 元素的集合中的位置;当所述匹配元素的集合中匹配元素的个数少于所述 目标元素的集合中目标元素的个数, 所述第二确定单元具体用于: 根据所 述调色板模板中元素的预测标识、所述第二预测位置信息和所述匹配元素 的集合,确定所述目标元素的集合中的所述至少一个第一类元素的数值和 位置;从所述目标图像块的码流中获取所述目标元素的集合中的所述至少 一个第二类元素的数值。  With reference to the seventh embodiment of the third aspect, in the eighth implementation manner of the third aspect, when the set of matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of matching elements is less than the target element in the set of the target element The second determining unit is specifically configured to: determine, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of matching elements, in the set of the target elements a value and a position of the at least one first type element; obtaining a value of the at least one second type element in the set of the target elements from a code stream of the target image block.
结合第三方面的第七实施方式, 在第三方面的第九实施方式中, 当所 述匹配元素的集合为非空, 所述预测信息还包括第二预测位置信息, 所述 第二预测位置信息用于指示所述匹配元素对应的第一类元素在所述目标 元素的集合中的位置;当所述匹配元素的集合中匹配元素的个数等于所述 目标元素的集合中目标元素的个数, 所述第二确定单元具体用于: 根据所 述调色板模板中元素的预测标识、所述第二预测位置信息和所述匹配元素 的集合,确定所述目标元素的集合中的所述至少一个第一类元素的数值和 位置。  With reference to the seventh embodiment of the third aspect, in a ninth implementation manner of the third aspect, when the set of the matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location The information is used to indicate a position of the first type element corresponding to the matching element in the set of the target element; when the number of matching elements in the set of the matching element is equal to the target element in the set of the target element The second determining unit is specifically configured to: determine, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of the matching elements, the location in the set of the target elements The value and location of at least one first type of element.
结合第三方面的第七实施方式, 在第三方面的第十实施方式中, 当所 述匹配元素的集合为非空,当所述匹配元素的集合中匹配元素的个数少于 或等于所述目标元素的集合中目标元素的个数,所述第二确定单元具体用 于: 按照数值大小的升序或降序排列,根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 结合第三方面的第八、 第九或第十实施方式, 在第三方面的第十一实 施方式中, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差 值信息用于指示所述目标调色板中所述第一类元素与其在所述调色板模 板中的匹配元素的差值; 所述第二确定单元还用于: 根据所述第二预测差 值信息, 调整所述目标元素的集合中的所述至少一个第一类元素的数值。 With reference to the seventh embodiment of the third aspect, in a tenth implementation manner of the third aspect, when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to a number of target elements in the set of target elements, the second determining unit is specifically configured to: sort in ascending or descending order according to the numerical size, and predict the identifier and the matching according to the element A collection of elements that determine the value of all of the target elements in the set of target elements and their locations. With reference to the eighth, ninth or tenth implementation manner of the third aspect, in the eleventh implementation manner of the third aspect, the prediction information further includes second prediction difference information, wherein the second prediction difference information a difference between the first type of elements in the target palette and a matching element in the palette template; the second determining unit is further configured to: according to the second predicted difference Information, adjusting a value of the at least one first type element in the set of the target elements.
结合第三方面的第一实施方式, 在第三方面的第十二实施方式中, 所 述预测信息还包括第一索引信息,其中所述第一索引信息用于指示所述匹 配元素的集合中全部匹配元素在所述调色板模板中的对应位置;所述第一 确定单元具体用于: 当所述元素预测标识为所述目标调色板的预测标识, 且所述目标调色板的预测标识指示所述目标调色板中的所述至少一个第 一类元素,确定所述调色板模板中由所述第一索引信息指示的对应位置的 全部匹配元素构成在所述调色板模板中的匹配元素的集合。  With reference to the first embodiment of the third aspect, in the twelfth implementation of the third aspect, the prediction information further includes first index information, wherein the first index information is used to indicate the set of matching elements a corresponding position of all the matching elements in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is a predicted identifier of the target palette, and the target palette The prediction identifier indicates the at least one first type element in the target palette, and determining that all matching elements of the corresponding position indicated by the first index information in the palette template are formed in the palette A collection of matching elements in a template.
结合第三方面的第一实施方式, 在第三方面的第十三实施方式中, 当 所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中目标 元素的个数, 所述第二确定单元具体用于: 根据所述目标调色板的预测标 识、 所述第一索引信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置;从所述目标图像块的码流中 获取所述目标元素的集合中的所述至少一个第二类元素的数值。  With reference to the first embodiment of the third aspect, in the thirteenth implementation of the third aspect, when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, The second determining unit is specifically configured to: determine, according to the predicted identifier of the target palette, the first index information, and the set of matching elements, the at least one of the set of target elements The value and location of the class element; the value of the at least one second class element in the set of the target elements is obtained from the code stream of the target image block.
结合第三方面的第一实施方式, 在第三方面的第十四实施方式中, 当 所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中目标 元素的个数, 所述第二确定单元具体用于: 根据所述目标调色板的预测标 识、 所述第一索引信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置。  With reference to the first embodiment of the third aspect, in the fourteenth implementation of the third aspect, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, The second determining unit is specifically configured to: determine, according to the prediction identifier of the target palette, the first index information, and the set of matching elements, the at least one first category in the set of target elements The value and position of the element.
结合第三方面的第一实施方式, 在第三方面的第十五实施方式中, 当 所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的集合 中目标元素的个数, 所述第二确定单元具体用于: 按照数值大小的升序或 降序排列,根据所述元素预测标识和所述匹配元素的集合, 确定所述目标 元素的集合中全部目标元素的数值及其位置。 结合第三方面的第十三、 第十四或第十五实施方式, 在第三方面的第 十六实施方式中, 所述预测信息还包括第一预测差值信息, 其中所述第一 预测差值信息用于指示所述目标调色板中所述至少一个第一类元素中每 个第一类元素与其在所述调色板模板中的匹配元素的差值;所述第二确定 单元进一步用于: 根据所述第一预测差值信息, 调整所述目标元素的集合 中的所述至少一个第一类元素的数值。 With reference to the first embodiment of the third aspect, in the fifteenth implementation of the third aspect, the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements The second determining unit is specifically configured to: arrange the values of all the target elements in the set of the target elements according to the element prediction identifier and the set of matching elements according to the ascending or descending order of the numerical values position. With reference to the thirteenth, fourteenth or fifteenth embodiment of the third aspect, in the sixteenth embodiment of the third aspect, the prediction information further includes first prediction difference information, wherein the first prediction The difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit Further for: adjusting, according to the first predicted difference information, a value of the at least one first type element in the set of target elements.
结合第三方面的第一实施方式, 在第三方面的第十七实施方式中, 所 述预测信息还包括第二索引信息,其中所述第二索引信息用于指示所述匹 配元素在所述调色板模板中的对应位置; 所述第一确定单元具体用于: 当 所述元素预测标识为所述目标调色板中元素的预测标识,且所述目标调色 板中目标元素的预测标识用于指示所述目标元素为第一类元素,依次确定 所述调色板模板中由所述第二索引信息指示的对应位置的匹配元素,所确 定的全部所述匹配元素构成在所述调色板模板中的所述匹配元素的集合。  With reference to the first embodiment of the third aspect, in the seventeenth implementation of the third aspect, the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the a corresponding position in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is a predicted identifier of an element in the target palette, and the prediction of the target element in the target palette The identifier is used to indicate that the target element is a first type of element, and the matching elements of the corresponding position indicated by the second index information in the palette template are sequentially determined, and all the matched elements determined are configured in the A collection of the matching elements in the palette template.
结合第三方面的第十七实施方式, 在第三方面的第十八实施方式中, 当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中目 标元素的个数, 所述第二确定单元具体用于: 根据所述目标调色板中元素 的预测标识、 所述第二索引信息和所述匹配元素的集合, 确定所述目标元 素的集合中的所述至少一个第一类元素的数值和位置;从所述目标图像块 的码流中获取所述目标元素的集合中的所述至少一个第二类元素的数值。  With reference to the seventeenth embodiment of the third aspect, in the eighteenth aspect of the third aspect, the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements The second determining unit is specifically configured to: determine, according to the predicted identifier of the element in the target palette, the second index information, and the set of matching elements, the at least the set of the target elements a value and a position of a first type of element; obtaining a value of the at least one second type element in the set of the target elements from a code stream of the target image block.
结合第三方面的第十七实施方式, 在第三方面的第十九实施方式中, 当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中目 标元素的个数, 所述第二确定单元具体用于: 根据所述目标调色板中元素 的预测标识、 所述第二索引信息和所述匹配元素的集合, 确定所述目标元 素的集合中的所述至少一个第一类元素的数值和位置。  With reference to the seventeenth embodiment of the third aspect, in the nineteenth implementation of the third aspect, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, The second determining unit is specifically configured to: determine the at least one of the set of the target elements according to the predicted identifier of the element in the target palette, the second index information, and the set of matching elements The value and location of the first type of element.
结合第三方面的第十七实施方式, 在第三方面的第二十实施方式中, 当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的集 合中目标元素的个数, 所述第二确定单元具体用于: 按照数值大小的升序 或降序排列, 根据所述元素预测标识和所述匹配元素的集合, 确定所述目 标元素的集合中全部目标元素的数值及其位置。 结合第三方面的第十八、 第十九或第二十实施方式, 在第三方面的第 二十一实施方式中, 所述预测信息还包括第二预测差值信息, 其中所述第 二预测差值信息用于指示所述目标调色板中所述第一类元素与其在所述 调色板模板中的匹配元素的差值; 所述第二确定单元进一步用于: 根据所 述第二预测差值信息,调整确定所述目标元素的集合中的所述至少一个第 一类元素的数值。 With reference to the seventeenth implementation manner of the third aspect, in the twentieth implementation manner of the third aspect, the number of matching elements in the set of the matching elements is less than or equal to the target element in the set of the target elements The second determining unit is specifically configured to: arrange the values of all the target elements in the set of the target elements according to the element prediction identifier and the set of matching elements according to the ascending or descending order of the numerical values. Its location. With reference to the eighteenth, nineteenth or twentieth embodiment of the third aspect, in the twenty-first embodiment of the third aspect, the prediction information further includes second predicted difference information, wherein the second The prediction difference information is used to indicate a difference between the first type of elements in the target palette and the matching elements in the palette template; the second determining unit is further configured to: according to the And predicting difference information, and adjusting a value of the at least one first type element in the set of the target elements.
结合第三方面的第一实施方式, 在第三方面的第二十二实施方式中, 所述预测信息还包括第一索引信息,其中所述第一索引信息用于指示所述 匹配元素的集合中全部匹配元素在所述调色板模板中的对应位置;所述第 一确定单元具体用于:当所述元素预测标识为所述调色板模板中所述匹配 元素的集合中所述匹配元素的数目, 且所述数目大于或等于 1 , 确定所述 调色板模板中由所述第一索引信息指示的对应位置的全部匹配元素构成 所述调色板模板中的匹配元素的集合,其中所述调色板模板中所述匹配元 素的集合中所述匹配元素的数目用于指示为所述目标调色板能够在所述 调色板模板中找到匹配元素的个数。  With reference to the first embodiment of the third aspect, in the twenty-second implementation manner of the third aspect, the prediction information further includes first index information, where the first index information is used to indicate the set of matching elements a corresponding position of all matching elements in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is the matching in the set of the matching elements in the palette template a number of elements, and the number is greater than or equal to 1, determining that all matching elements of the corresponding position indicated by the first index information in the palette template constitute a set of matching elements in the palette template, Wherein the number of the matching elements in the set of matching elements in the palette template is used to indicate the number of matching elements that can be found in the palette template for the target palette.
结合第三方面的第二十二实施方式,在第三方面的第二十三实施方式 中, 所述预测信息还包括第一预测位置信息, 所述第一预测位置信息用于 指示所述匹配元素的集合分别对应的第一类元素在所述目标元素的集合 中的位置;当所述匹配元素的集合中匹配元素的个数少于所述目标元素的 集合中目标元素的个数, 所述第二确定单元具体用于: 根据所述调色板模 板中所述匹配元素的集合中所述匹配元素的数目、所述第一预测位置信息 和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一 类元素的数值和位置;从所述目标图像块的码流中获取所述目标元素的集 合中的所述至少一个第二类元素的数值。  With reference to the twenty-second implementation of the third aspect, in the twenty-third implementation of the third aspect, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first class element in the set of target elements; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, The second determining unit is specifically configured to: determine the target according to the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements. a value and a location of the at least one first class element in the set of elements; obtaining a value of the at least one second class element of the set of target elements from a code stream of the target image block.
结合第三方面的第二十二实施方式,在第三方面的第二十四实施方式 中, 所述预测信息还包括第一预测位置信息, 所述第一预测位置信息用于 指示所述匹配元素的集合分别对应的第一类元素在所述目标元素的集合 中的位置;当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述第二确定单元具体用于: 根据所述调色板模 板中所述匹配元素的集合中所述匹配元素的数目、所述第一预测位置信息 和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一 类元素的数值和位置。 With reference to the twenty-second embodiment of the third aspect, in the twenty-fourth implementation of the third aspect, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching a set of elements respectively corresponding to a position of the first type of elements in the set of target elements; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, The second determining unit is specifically configured to: according to the palette mode Determining, in the set of the matching elements in the set of the matching elements, the first predicted position information, and the set of the matching elements, determining a value of the at least one first type element in the set of the target elements And location.
结合第三方面的第二十二实施方式,在第三方面的第二十五实施方式 中,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的 集合中目标元素的个数, 所述第二确定单元具体用于: 按照数值大小的升 序或降序排列,根据所述元素预测标识和所述匹配元素的集合, 确定所述 目标元素的集合中全部目标元素的数值及其位置。  With reference to the twenty-second embodiment of the third aspect, in the twenty-fifth implementation of the third aspect, the number of matching elements in the set of matching elements is less than or equal to the target in the set of the target elements The second determining unit is specifically configured to: arrange in ascending or descending order of the numerical value, and determine, according to the element prediction identifier and the set of the matching elements, all the target elements in the set of the target elements The value and its location.
结合第三方面的第二十三、 第二十四或第二十五实施方式, 在第三方 面的第二十六实施方式中, 所述预测信息还包括第一预测差值信息, 其中 所述第一预测差值信息用于指示所述目标调色板中所述至少一个第一类 元素中每个第一类元素与其在所述调色板模板中的匹配元素的差值;所述 第二确定单元还用于: 根据所述第一预测差值信息, 调整所述目标元素的 集合中的所述至少一个第一类元素的数值。  With reference to the twenty-third, twenty-fourth or twenty-fifth implementation manner of the third aspect, in the twenty-sixth implementation manner of the third aspect, the prediction information further includes first prediction difference information, where The first predicted difference value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; The second determining unit is further configured to: adjust, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
结合第三方面的第一实施方式, 在第三方面的第二十七实施方式中, 所述预测信息还包括第二索引信息,其中所述第二索引信息用于指示所述 匹配元素在所述调色板模板中的对应位置; 所述第一确定单元具体用于: 当所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述匹 配元素的数目, 且所述数目大于或等于 1 , 依次确定所述调色板模板中由 所述第二索引信息指示的对应位置的匹配元素,所确定的全部所述匹配元 素构成所述调色板模板中的匹配元素的集合,其中所述调色板模板中所述 匹配元素的集合中所述匹配元素的数目用于指示为所述目标调色板能够 在所述调色板模板中找到匹配元素的个数。  With reference to the first embodiment of the third aspect, in the twenty-seventh implementation of the third aspect, the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the Corresponding position in the palette template; the first determining unit is specifically configured to: when the element prediction identifier is the number of the matching elements in the set of the matching elements in the palette template, and The number is greater than or equal to 1, and the matching elements of the corresponding positions indicated by the second index information in the palette template are sequentially determined, and all the matched elements determined to form a matching element in the palette template A collection of the number of matching elements in the set of matching elements in the palette template for indicating the number of matching elements that can be found in the palette template for the target palette.
结合第三方面的第二十七实施方式,在第三方面的第二十八实施方式 中, 所述预测信息还包括第二预测位置信息, 所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置;当 所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中目标 元素的个数, 所述第二确定单元具体用于: 根据所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目、所述第二预测位置信息和所述匹配 元素的集合,确定所述目标元素的集合中的所述至少一个第一类元素的数 值和位置;从所述目标图像块的码流中获取所述目标元素的集合中的所述 至少一个第二类元素的数值。 In conjunction with the twenty-seventh implementation of the third aspect, in the twenty-eighth implementation manner of the third aspect, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target element, the second The determining unit is specifically configured to:: according to the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the matching a set of elements, determining a value and a position of the at least one first type element in the set of the target elements; acquiring the at least one of the set of the target elements from a code stream of the target image block The value of the second type of element.
结合第三方面的第二十七实施方式,在第三方面的第二十九实施方式 中, 所述预测信息还包括第二预测位置信息, 所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置;当 所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中目标 元素的个数, 所述第二确定单元具体用于: 根据所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目、所述第二预测位置信息和所述匹配 元素的集合,确定所述目标元素的集合中的所述至少一个第一类元素的数 值和位置。  In conjunction with the twenty-seventh implementation of the third aspect, in the twenty-ninth implementation manner of the third aspect, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate the matching a position of the first type element corresponding to the element in the set of the target element; when the number of matching elements in the set of the matching element is equal to the number of the target elements in the set of the target element, the second determining The unit is specifically configured to: determine, according to the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the set of matching elements, The value and location of the at least one first type of element.
结合第三方面的第二十七实施方式, 在第三方面的第三十实施方式 中,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标元素的 集合中目标元素的个数, 所述第二确定单元具体用于: 按照数值大小的升 序或降序排列,根据所述元素预测标识和所述匹配元素的集合, 确定所述 目标元素的集合中全部目标元素的数值及其位置。  With reference to the twenty-seventh embodiment of the third aspect, in the thirtieth embodiment of the third aspect, the number of matching elements in the set of matching elements is less than or equal to the target element in the set of the target elements The second determining unit is specifically configured to: arrange the values of all the target elements in the set of the target elements according to the element prediction identifier and the set of the matching elements according to the ascending or descending order of the numerical values. And its location.
结合第三方面的第二十八、 第二十九或第三十实施方式, 在第三方面 的第三十一实施方式中, 所述预测信息还包括第二预测差值信息, 其中所 述第二预测差值信息用于指示所述目标调色板中所述第一类元素与其在 所述调色板模板中的匹配元素的差值; 所述第二确定单元还用于: 根据所 述第二预测差值信息,调整所述目标元素的集合中的所述至少一个第一类 元素的数值。  With reference to the twenty-eighth, twenty-ninth or thirtieth embodiment of the third aspect, in the thirty-first embodiment of the third aspect, the prediction information further includes second predicted difference information, wherein The second prediction difference information is used to indicate a difference between the first type of elements in the target palette and the matching elements in the palette template; the second determining unit is further configured to: The second predicted difference information is adjusted to adjust a value of the at least one first type element in the set of target elements.
结合第三方面及其各个实施方式, 在第三方面的第三十二实施方式 中, 所述预测信息还包括预测指示信息, 所述预测指示信息用于指示所述 目标调色板中是否存在一个所述第一类元素能够根据所述预测信息与所 述匹配元素的集合而确定。  With reference to the third aspect and various embodiments thereof, in the thirty-second implementation manner of the third aspect, the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether the target color palette exists One of the first type of elements can be determined based on the prediction information and the set of matching elements.
结合第三方面及其各个实施方式, 在第三方面的第三十三实施方式 中, 还包括: 第一预设单元, 用于在所述根据所述预测信息, 确定在所述 调色板模板中的匹配元素的集合之前, 预设所述调色板模板。 结合第三方面及其各个实施方式, 在第三方面的第三十四实施方式 中, 还包括: 第一更新单元, 用于在所述根据所述预测信息与所述匹配元 素的集合, 确定所述目标元素的集合之后,根据所述目标元素的集合中的 所述目标元素以及所述调色板模板中的所述匹配元素对应的计数器数值, 更新所述调色板模板。 With reference to the third aspect and various embodiments thereof, in a thirty-third implementation manner of the third aspect, the method further includes: a first preset unit, configured to determine, in the color palette, according to the prediction information The palette template is preset before the collection of matching elements in the template. With reference to the third aspect and various embodiments thereof, in a thirty-fourth implementation manner of the third aspect, the method further includes: a first updating unit, configured to determine, according to the prediction information and the set of matching elements, After the collection of the target elements, the palette template is updated according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template.
结合第三方面的第三十四实施方式,在第三方面的第三十五实施方式 中, 所述第一更新单元具体用于: 利用所述目标调色板中的所述至少一个 第二类元素, 更新所述调色板模板中所述非匹配元素的集合; 利用所述目 标调色板中的所述目标元素,更新所述调色板模板中与元素对应的计数器 数值。  With reference to the thirty-fourth implementation of the third aspect, in the thirty-fifth implementation of the third aspect, the first updating unit is specifically configured to: utilize the at least one second in the target palette a class element, updating a set of the non-matching elements in the palette template; updating the counter value corresponding to the element in the palette template by using the target element in the target palette.
第四方面, 提出了一种编码器, 包括: 构造单元, 用于构造目标调色 板, 其中所述目标调色板是目标元素的集合, 所述目标元素的集合中的每 个目标元素是基于所述目标图像块的一个信号分量的釆样点数值确定的 具有代表性的数值,其中所述目标元素的集合包括至少一个第一类元素和 /或至少一个第二类元素, 所述第一类元素是需要根据调色板模板中的匹 配元素确定的目标元素,所述第二类元素无需根据调色板模板中的匹配元 素确定的目标元素; 预处理单元, 用于确定所述构造单元构造的所述目标 调色板的预测信息, 并根据所述预测信息对所述目标调色板进行预测编 码,以便确定所述目标调色板中的所述至少一个第一类元素在所述调色板 模板中的匹配元素的集合, 其中所述调色板模板由匹配元素的集合和 /或 非匹配元素的集合组成, 所述匹配元素的集合包括至少一个匹配元素, 所 述匹配元素是用于匹配所述第一类元素的元素,所述第一类元素的数值与 其匹配元素的数值之差的绝对值小于预定值,所述非匹配元素的集合包括 至少一个非匹配元素,所述非匹配元素是无法与所述第一类元素匹配的元 素; 编码单元, 用于根据所述预处理单元预测编码的目标调色板中所述目 标元素的集合以及索引表, 对所述目标图像块进行编码。  In a fourth aspect, an encoder is provided, comprising: a construction unit, configured to construct a target palette, wherein the target palette is a collection of target elements, and each target element in the set of target elements is a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one first class element and/or at least one second class element, the One type of element is a target element that needs to be determined according to a matching element in a palette template, the second type element does not need a target element determined according to a matching element in the palette template; a pre-processing unit for determining the configuration Predicting information of the target palette constructed by the unit, and predictively encoding the target palette according to the prediction information, so as to determine that the at least one first type element in the target palette is in the a collection of matching elements in a palette template, wherein the palette template consists of a collection of matching elements and/or a collection of non-matching elements, The set of matching elements includes at least one matching element, the matching element is an element for matching the first type of element, and an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value And the set of the non-matching elements includes at least one non-matching element, the non-matching element is an element that cannot match the first type of element; a coding unit, configured to predict the encoded target color according to the pre-processing unit A set of target elements in the board and an index table that encodes the target image block.
结合第四方面, 在第四方面的第一实施方式中, 所述预测信息包括元 素预测标识, 所述元素预测标识为所述调色板模板的预测标识, 其中所述 调色板模板的预测标识用于指示所述调色板模板中的所述匹配元素的集 合与所述非匹配元素的集合;或者所述元素预测标识为所述调色板模板中 元素的预测标识,其中所述调色板模板中元素的预测标识用于指示所述调 色板模板中所述元素为匹配元素或非匹配元素;或者所述元素预测标识为 所述目标调色板的预测标识,其中所述目标调色板的预测标识用于指示所 述目标元素的集合中的第一类元素和 /或第二类元素; 或者所述元素预测 标识为所述目标调色板中元素的预测标识,其中所述目标调色板中目标元 素的预测标识用于指示所述目标元素为第一类元素或第二类元素;或者所 述元素预测标识为所述调色板模板中所述匹配元素的集合中所述匹配元 素的数目,用于指示为所述目标调色板能够在所述调色板模板中找到匹配 元素的个数。 With reference to the fourth aspect, in a first implementation manner of the fourth aspect, the prediction information includes an element prediction identifier, where the element prediction identifier is a prediction identifier of the palette template, where the palette template is predicted Identifying a set for indicating the matching element in the palette template And a set of the non-matching elements; or the element prediction identifier is a predicted identifier of an element in the palette template, wherein a predicted identifier of an element in the palette template is used to indicate the palette template The element is a matching element or a non-matching element; or the element predictive identifier is a predicted identifier of the target palette, wherein the predicted identifier of the target palette is used to indicate in the set of the target element a first type of element and/or a second type of element; or the element prediction identifier is a predicted identifier of an element in the target palette, wherein a predicted identifier of the target element in the target palette is used to indicate the target The element is a first type element or a second type element; or the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, used to indicate the target color palette The number of matching elements can be found in the palette template.
结合第四方面的第一实施方式, 在第四方面的第二实施方式中, 所述 预测信息还包括第一预测位置信息,所述第一预测位置信息用于指示所述 匹配元素的集合分别对应的第一类元素在所述目标元素的集合中的位置; 或者所述预测信息还包括第二预测位置信息,所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置。  With reference to the first embodiment of the fourth aspect, in the second implementation manner of the fourth aspect, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the set of the matching elements are respectively a location of the corresponding first type of element in the set of the target element; or the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a first type of element corresponding to the matching element The position in the set of target elements.
结合第四方面的第一或第二实施方式, 在第四方面的第三实施方式 中, 所述预测信息还包括第一索引信息, 其中所述第一索引信息用于指示 所述匹配元素的集合中全部匹配元素在所述调色板模板中的对应位置;或 者所述预测信息还包括第二索引信息,其中所述第二索引信息用于指示所 述匹配元素在所述调色板模板中的对应位置。  With reference to the first or second implementation manner of the fourth aspect, in the third implementation manner of the fourth aspect, the prediction information further includes first index information, where the first index information is used to indicate the matching element a corresponding position of all matching elements in the set in the palette template; or the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the palette template The corresponding position in .
结合第四方面的第一至第三实施方式, 在第四方面的第四实施方式 中, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息 用于指示所述目标调色板中所述至少一个第一类元素中每个第一类元素 与其在所述调色板模板中的匹配元素的差值;或者所述预测信息还包括第 二预测差值信息,其中所述第二预测差值信息用于指示所述目标调色板中 所述第一类元素与其在所述调色板模板中的匹配元素的差值。  With reference to the first to third embodiments of the fourth aspect, in the fourth implementation manner of the fourth aspect, the prediction information further includes first predicted difference information, where the first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; or the prediction information further includes second predicted difference information And wherein the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template.
结合第四方面及其各个实施方式, 在第四方面的第五实施方式中, 所 述预测信息还包括预测指示信息,所述预测指示信息用于指示所述目标调 色板中是否存在一个所述第一类元素能够根据所述预测信息与所述匹配 元素的集合而确定。 With reference to the fourth aspect and various embodiments thereof, in a fifth implementation manner of the fourth aspect, the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether a target exists in the target color palette The first type of element can match the prediction according to the prediction information Determined by the collection of elements.
结合第四方面及其各个实施方式, 在第四方面的第六实施方式中, 还 包括: 第二预设单元, 用于在所述确定所述目标调色板的预测信息之前, 预设所述调色板模板。  With reference to the fourth aspect and various embodiments thereof, in a sixth implementation manner of the fourth aspect, the method further includes: a second preset unit, configured to: before the determining the prediction information of the target color palette, preset The palette template.
结合第四方面及其各个实施方式, 在第四方面的第七实施方式中, 还 包括: 第二更新单元, 用于在所述根据所述预测信息对所述目标调色板进 行预测编码之后,根据所述目标元素的集合中的所述目标元素以及所述调 色板模板中的所述匹配元素对应的计数器数值, 更新所述调色板模板。  With reference to the fourth aspect and various embodiments thereof, in a seventh implementation manner of the fourth aspect, the method further includes: a second updating unit, configured to perform predictive coding on the target color palette according to the prediction information, Updating the palette template according to the target element in the set of target elements and the counter value corresponding to the matching element in the palette template.
结合第四方面及其各个实施方式, 在第四方面的第八实施方式中, 所 述第二更新单元具体用于:利用所述目标调色板中的所述至少一个第二类 元素, 更新所述调色板模板中所述非匹配元素的集合; 利用所述目标调色 板中的所述目标元素, 更新所述调色板模板中与元素对应的计数器数值。  With reference to the fourth aspect and various embodiments thereof, in the eighth implementation manner of the fourth aspect, the second updating unit is specifically configured to: update by using the at least one second type element in the target color palette a set of the non-matching elements in the palette template; updating the counter value corresponding to the element in the palette template by using the target element in the target palette.
本发明实施例通过例如预测信息对目标调色板进行预测编码,以减少 目标调色板的编码开销,从而进一步提高釆用调色板编码模式的视频图像 的压缩效率。 附图说明  Embodiments of the present invention predictively encode a target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode. DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例 中所需要使用的附图作简单地介绍, 显而易见地, 下面所描述的附图仅仅 是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性 劳动的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments of the present invention will be briefly described below. It is obvious that the drawings described below are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图 1是根据本发明实施例的目标图像块的解码方法的流程图。  1 is a flow chart of a decoding method of a target image block according to an embodiment of the present invention.
图 2是根据本发明实施例的目标图像块的编码方法的流程图。  2 is a flow chart of a method of encoding a target image block in accordance with an embodiment of the present invention.
图 3是根据本发明一个实施例的解码器的结构示意图。  FIG. 3 is a schematic structural diagram of a decoder according to an embodiment of the present invention.
图 4是根据本发明另一实施例的解码器的结构示意图。  4 is a schematic structural diagram of a decoder according to another embodiment of the present invention.
图 5是根据本发明另一实施例的解码器的结构示意图。  FIG. 5 is a schematic structural diagram of a decoder according to another embodiment of the present invention.
图 6是根据本发明一个实施例的编码器的结构示意图。  Figure 6 is a block diagram showing the structure of an encoder in accordance with one embodiment of the present invention.
图 7是根据本发明另一实施例的编码器的结构示意图。  FIG. 7 is a schematic structural diagram of an encoder according to another embodiment of the present invention.
图 8是根据本发明另一实施例的编码器的结构示意图。 具体实施方式 FIG. 8 is a schematic structural diagram of an encoder according to another embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进 行清楚、 完整地描述, 显然, 所描述的实施例是本发明的一部分实施例, 而不是全部实施例。基于本发明中的实施例, 本领域普通技术人员在没有 做出创造性劳动的前提下所获得的所有其他实施例,都应属于本发明保护 的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
为了清楚地说明本发明实施例的编解码方法,需要首先明确以下几个 概念。  In order to clearly illustrate the codec method of the embodiment of the present invention, it is necessary to first clarify the following concepts.
调色板: 由一组元素组成, 每个元素是目标图像块的信号分量所有釆 样点中具有代表性的釆样点数值,其中调色板的大小即调色板中元素的数 量。 调色板中元素的数量与数值可通过动态规划算法确定。  Palette: Consists of a set of elements, each of which is the representative sample point value of all the sample points of the signal component of the target image block, where the size of the palette is the number of elements in the palette. The number and value of the elements in the palette can be determined by a dynamic programming algorithm.
目标调色板: 目标图像块中一个信号分量的调色板。 目标图像块是釆 用调色板编码模式的图像块。信号分量可以是目标图像块的各信号分量中 的任意一个。 例如, 若目标图像块的信号格式为 YUV , 则一个信号分量可 以是 Y、 U、 V分量中的任一个。 再例如, 若目标图像块的信号格式为 RGB , 则一个信号分量可以是1 、 G、 B分量中的任一个。  Target palette: A palette of one signal component in the target image block. The target image block is an image block in the palette encoding mode. The signal component may be any one of the signal components of the target image block. For example, if the signal format of the target image block is YUV, one of the signal components may be any of the Y, U, and V components. For another example, if the signal format of the target image block is RGB, one signal component may be any one of the 1, G, and B components.
调色板模板: 为一组元素, 在一个序列或者一幅图像或者一个片编码 过程开始时初始化, 即将其中所有元素设置为预定初始值 (比如 - 1 )。 调 色板模板中的元素可用来预测目标调色板中元素。  Palette template: Initializes a set of elements at the beginning of a sequence or an image or a slice encoding process, setting all of them to a predetermined initial value (such as -1 ). The elements in the palette template can be used to predict the elements in the target palette.
下面,具体结合图 1详细描述根据本发明实施例的目标图像块的解码 方法。  Hereinafter, a decoding method of a target image block according to an embodiment of the present invention will be described in detail with reference to FIG.
S 1 1 , 从接收到的目标图像块的码流中获取目标调色板的预测信息, 其中所述目标图像块是釆用调色板编码模式的图像块,所述目标调色板是 目标元素的集合,所述目标元素的集合中的每个目标元素是基于所述目标 图像块的一个信号分量的釆样点数值确定的具有代表性的数值,其中所述 目标元素的集合包括至少一个第一类元素和 /或至少一个第二类元素, 所 述第一类元素是需要根据调色板模板中的匹配元素确定的目标元素,所述 第二类元素无需根据调色板模板中的匹配元素确定的目标元素。  S 1 1 , obtaining prediction information of a target palette from a code stream of the received target image block, wherein the target image block is an image block in a palette encoding mode, and the target color palette is a target a set of elements, each of the set of target elements being a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one a first type of element and/or at least one second type of element, the first type of element being a target element that needs to be determined according to a matching element in the palette template, the second type of element not being based on the palette template Matches the target element determined by the element.
由此可见, 目标调色板中的目标元素有可能在调色板模板中找到匹配 元素, 也可能在调色板模板中找不到匹配元素。 Thus, it is possible that the target element in the target palette is likely to find a match in the palette template. The element may also not find a matching element in the palette template.
其中, 预测信息可以包括元素预测标识。  The prediction information may include an element prediction identifier.
元素预测标识可以是调色板模板中元素的预测标识,用于指示调色板 模板中所述元素是否为目标调色板中第一类元素的匹配元素。 例如, 可以 为调色板模板中的每一个元素传输一个二进制符号作为该调色板模板中 元素的预测标识。 当调色板模板中元素的预测标识为 1时,表示该元素为 目标调色板中第一类元素的匹配元素;当调色板模板中元素的预测标识为 The element prediction identifier may be a predictive identifier of an element in the palette template to indicate whether the element in the palette template is a matching element of the first type of element in the target palette. For example, you can transfer a binary symbol to each element in the palette template as the predictive identifier for the element in the palette template. When the predicted identifier of an element in the palette template is 1, it indicates that the element is a matching element of the first type of element in the target palette; when the predicted identifier of the element in the palette template is
0时, 表示该元素不是目标调色板中第一类元素的匹配元素, 即为非匹配 元素。 当所述调色板模板中元素的预测标识指示该元素为匹配元素时, 所 述预测信息还包括第二预测位置信息,所述第二预测位置信息用于指示所 述匹配元素对应的第一类元素在所述目标元素的集合中的位置。可以使用 变长码字或定长码字来标识所述第二预测位置信息。若所述目标调色板的 长度为 1 6时, 可以使用长度为 4的定长码字来标识所述第二预测位置信 息。 0, indicating that the element is not a matching element of the first type of element in the target palette, that is, a non-matching element. When the predicted identifier of the element in the palette template indicates that the element is a matching element, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate that the matching element corresponds to the first The position of the class element in the set of target elements. The second predicted position information may be identified using a variable length codeword or a fixed length codeword. If the length of the target palette is 1 6 , a fixed length codeword of length 4 can be used to identify the second predicted location information.
或者, 元素预测标识可以是所述调色板模板的预测标识, 其中所述调 色板模板的预测标识用于指示所述调色板模板中的所述匹配元素的集合 与所述非匹配元素的集合。 例如, 若调色板模板中有 4个元素, 调色板模 板的预测标识为 ( 1 , 0, 0, 1 ) 是, 表示调色板模板中的第一和第四个元素 是匹配元素, 第二和第三元素是非匹配元素。 当所述调色板模板的预测标 识指示匹配元素的集合非空, 即至少存在一个匹配元素, 预测信息还包括 第一预测位置信息,所述第一预测位置信息用于指示所述匹配元素的集合 分别对应的第一类元素在所述目标元素的集合中的位置。  Or the element prediction identifier may be a prediction identifier of the palette template, where the prediction identifier of the palette template is used to indicate the set of the matching elements in the palette template and the non-matching element Collection. For example, if there are 4 elements in the palette template, the prediction identifier of the palette template is (1, 0, 0, 1) Yes, indicating that the first and fourth elements in the palette template are matching elements. The second and third elements are non-matching elements. When the prediction identifier of the palette template indicates that the set of matching elements is non-empty, that is, at least one matching element exists, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate the matching element. The position of the corresponding first class element in the set of the target element.
或者, 元素预测标识还可以是目标调色板中元素的预测标识, 用于指 示目标调色板中的目标元素是第一类元素还是第二类元素,即该目标元素 是否能够在调色板模板中找到其匹配元素。 例如, 可以为目标调色板中的 每一个目标元素传输一个二进制符号作为该目标调色板中元素的预测标 识。若所述元素预测标识表示该目标元素能够在调色板模板中找到其匹配 元素,则所述预测信息还包括用于指示所述匹配元素在调色板模板中的对 应位置的第二索引信息。可以使用定长码字或变长码字来标识该第二索引 信息。 例如, 当调色板模板大小为 8 (即其中包含 8个元素) 时, 可以使 用长度为 3的定长码字作为第二索引信息来标识该匹配元素的位置,或者 说来标识该匹配元素是这 8个元素中的哪一个。再例如, 可以使用最大值 为 8的截断一元码来作为第二索引信息来标识该匹配元素的位置。 Alternatively, the element prediction identifier may also be a prediction identifier of an element in the target palette, which is used to indicate whether the target element in the target palette is a first type element or a second type element, that is, whether the target element can be in the color palette. Find the matching element in the template. For example, a binary symbol can be transmitted for each target element in the target palette as a predictive identifier for the element in the target palette. If the element prediction identifier indicates that the target element can find its matching element in the palette template, the prediction information further includes second index information indicating a corresponding position of the matching element in the palette template. . A fixed length codeword or a variable length codeword can be used to identify the second index Information. For example, when the palette template size is 8 (ie, it contains 8 elements), a fixed length codeword of length 3 can be used as the second index information to identify the location of the matching element, or to identify the matching element. Which of these 8 elements is. As another example, a truncated unary code having a maximum value of 8 can be used as the second index information to identify the location of the matching element.
或者, 所述元素预测标识为所述目标调色板的预测标识, 其中所述目 标调色板的预测标识用于指示所述目标元素的集合中的第一类元素和 /或 第二类元素。 例如, 若目标调色板中有 6个目标元素, 目标调色板的预测 标识 ( 1 , 0, 0, 1 , 1 , 0 )表示第 1、 4、 5 目标元素为第一类目标元素, 第 2、 3、 6 目标元素为第二类目标元素。 当目标调色板的预测标识表示目标调 色板中的全部第一类元素时, 预测信息还可以包括第一索引信息, 其中所 述第一索引信息用于指示全部第一类元素对应的所述匹配元素的集合中 全部匹配元素在所述调色板模板中的对应位置。  Or the element prediction identifier is a prediction identifier of the target palette, where the prediction identifier of the target palette is used to indicate a first type element and/or a second type element in the set of the target element . For example, if there are 6 target elements in the target palette, the predicted identifier ( 1 , 0, 0, 1 , 1 , 0 ) of the target palette indicates that the first, fourth, and fifth target elements are the first type of target elements. The second, third, and sixth target elements are the second type of target elements. When the prediction identifier of the target palette represents all the first type elements in the target palette, the prediction information may further include first index information, where the first index information is used to indicate that all the first type elements correspond to A corresponding position of all matching elements in the set of matching elements in the palette template.
或者,元素预测标识还可以是调色板模板中所述匹配元素的集合中所 述匹配元素的数目,用于指示为目标调色板能够在调色板模板中找到匹配 元素的个数。 这样, 预测信息还包括第一索引信息和第一预测位置信息。 或者,预测信息还可以包括第二索引信息和第二预测位置信息,可以理解, 第二索引信息或第二预测位置信息的数目为所述调色板模板中匹配元素 的数目。  Alternatively, the element prediction identifier may also be the number of matching elements in the set of matching elements in the palette template for indicating the number of matching elements that can be found in the palette template for the target palette. Thus, the prediction information further includes first index information and first predicted location information. Alternatively, the prediction information may further include second index information and second predicted location information, it being understood that the number of the second index information or the second predicted location information is the number of matching elements in the palette template.
此外,预测信息还可以进一步包括第一预测差值信息或第二预测差值 信息。  Furthermore, the prediction information may further include first prediction difference information or second prediction difference information.
例如,第二预测差值信息用于指示所述目标调色板中所述第一类元素 与其在所述调色板模板中的匹配元素的差值。第二预测差值信息还可以进 一步分解为预测差值绝对值和预测差值符号。仅当预测差值绝对值不为零 时, 才需要获取预测差值符号。  For example, the second predicted difference information is used to indicate a difference between the first type of elements in the target palette and its matching elements in the palette template. The second predicted difference information can be further decomposed into the predicted difference absolute value and the predicted difference sign. It is only necessary to obtain the predicted difference symbol when the absolute value of the prediction difference is not zero.
例如, 可以使用定长码字或变长码字来标识所述预测差值绝对值, 可 以为所述预测差值绝对值设定一个最大值,该最大值可以预先设定或从码 流中获得。 例如, 预设所述预测差值最大值为 3 时, 可以使用长度为 2 的定长码字来标识该预测差值绝对值,也可以使用最大值为 3的截断一元 码来标识该预测差值绝对值。 例如, 可以使用一个二进制符号来标识预测预测差值符号。 例如可用 二进制符号 0表示预测差值为负数,用二进制符号 1表示预测差值为正数。 For example, a fixed length codeword or a variable length codeword may be used to identify the absolute value of the predicted difference value, and a maximum value may be set for the absolute value of the predicted difference value, which may be preset or from the code stream. obtain. For example, when the maximum value of the prediction difference is preset to be 3, a fixed length codeword of length 2 may be used to identify the absolute value of the prediction difference, or a truncated unary code having a maximum value of 3 may be used to identify the prediction difference. The absolute value of the value. For example, a binary symbol can be used to identify the predicted predicted difference symbol. For example, the binary symbol 0 can be used to indicate that the prediction difference is a negative number, and the binary symbol 1 is used to indicate that the prediction difference is a positive number.
第一预测差值信息用于指示所述目标调色板中所述至少一个第一类 元素中每个第一类元素与其在所述调色板模板中的匹配元素的差值。  The first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and its matching elements in the palette template.
此外, 预测信息可以包括一个预测指示信息。  Further, the prediction information may include one prediction indication information.
预测指示信息用于指示目标调色板是否釆用本发明中所描述的调色 板预测方法, 即是否可以根据预测信息与匹配元素的集合, 至少确定目标 调色板中的一个第一类元素。例如,预测指示信息可以是一个二进制符号, 可用符号 0表示未釆用调色板预测方法,用符号 1表示釆用调色板预测方 法。 若目标调色板没有釆用调色板预测方法, 则可按照已有技术中方法确 定调色板中各目标元素。  The prediction indication information is used to indicate whether the target palette uses the palette prediction method described in the present invention, that is, whether at least one first type element in the target palette can be determined according to the prediction information and the set of matching elements. . For example, the prediction indication information may be a binary symbol, the symbol 0 may be used to indicate that the palette prediction method is not used, and the symbol 1 is used to indicate the palette prediction method. If the target palette does not use the palette prediction method, then each target element in the palette can be determined according to the prior art method.
S 1 2 , 根据所述预测信息, 确定在调色板模板中与所述至少一个第一 元素匹配的所述匹配元素的集合,其中所述调色板模板由匹配元素的集合 和 /或非匹配元素的集合组成, 所述匹配元素的集合包括至少一个匹配元 素, 所述匹配元素是用于匹配所述第一类元素的元素, 所述第一类元素的 数值与其匹配元素的数值之差的绝对值小于预定值,所述非匹配元素的集 合包括至少一个非匹配元素,所述非匹配元素是无法与所述第一类元素匹 配的元素。  S 1 2 , determining, according to the prediction information, a set of the matching elements that match the at least one first element in a palette template, wherein the palette template is composed of a matching element and/or a a set of matching elements, the set of matching elements including at least one matching element, the matching element is an element for matching the first type of element, and the difference between the value of the first type of element and the value of the matching element The absolute value is less than a predetermined value, and the set of non-matching elements includes at least one non-matching element, which is an element that cannot match the first type of element.
由此可见, 调色板模板中元素可能与目标调色板相匹配, 也可能无法 与目标调色板相匹配。  As you can see, the elements in the palette template may or may not match the target palette.
以下将结合实现方式,如何通过预测信息确定在所述调色板模板中的 匹配元素的集合。  In the following, in conjunction with the implementation, how the set of matching elements in the palette template is determined by the prediction information.
例如, 可以通过元素预测标识, 确定在所述调色板模板中的匹配元素 的集合。  For example, a set of matching elements in the palette template can be determined by an element prediction identifier.
在一个实施方式中,当所述元素预测标识为所述调色板模板的预测标 识,根据所述调色板模板的预测标识确定在所述调色板模板中的匹配元素 的集合,其中所述调色板模板的预测标识用于指示所述调色板模板中的所 述匹配元素的集合与所述非匹配元素的集合。  In one embodiment, when the element prediction identifier is a predicted identifier of the palette template, determining a set of matching elements in the palette template according to the predicted identifier of the palette template, wherein The prediction identifier of the palette template is used to indicate a set of the matching elements in the palette template and a set of the non-matching elements.
在另一实施方式中,当所述元素预测标识为所述调色板模板中元素的 预测标识,依次根据所述调色板模板中元素的预测标识确定在所述调色板 模板中的匹配元素,所确定的全部的所述匹配元素构成所述匹配元素的集 合,其中所述调色板模板中元素的预测标识用于指示所述调色板模板中所 述元素为匹配元素或非匹配元素。 In another embodiment, when the element prediction identifier is an element in the palette template a prediction identifier, which in turn determines a matching element in the palette template according to a predicted identifier of an element in the palette template, wherein all of the determined matching elements constitute a set of the matching elements, wherein the adjustment The predictive identity of the element in the swatch template is used to indicate that the element in the palette template is a matching element or a non-matching element.
在另一实施方式中,当所述元素预测标识为所述目标调色板的预测标 识,且所述目标调色板的预测标识指示所述目标调色板中的所述至少一个 第一类元素,确定所述调色板模板中由所述第一索引信息指示的对应位置 的全部匹配元素构成在所述调色板模板中的匹配元素的集合。  In another embodiment, when the element prediction identifier is a predicted identifier of the target palette, and the predicted identifier of the target palette indicates the at least one first category in the target palette And determining, by the element, all matching elements of the corresponding position indicated by the first index information in the palette template to form a set of matching elements in the palette template.
在另一实施方式中,当所述元素预测标识为所述目标调色板中元素的 预测标识,且所述目标调色板中目标元素的预测标识用于指示所述目标元 素为第一类元素,依次确定所述调色板模板中由所述第二索引信息指示的 对应位置的匹配元素,所确定的全部所述匹配元素构成在所述调色板模板 中的所述匹配元素的集合。  In another embodiment, when the element prediction identifier is a predicted identifier of an element in the target palette, and a predicted identifier of the target element in the target palette is used to indicate that the target element is a first category And determining, in sequence, matching elements of the corresponding positions indicated by the second index information in the palette template, all of the determined matching elements forming a set of the matching elements in the palette template .
在另一实施方式中,当所述元素预测标识为所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目, 且所述数目大于或等于 1 , 确定所 述调色板模板中由所述第一索引信息指示的对应位置的全部匹配元素构 成所述调色板模板中的匹配元素的集合,其中所述调色板模板中所述匹配 元素的集合中所述匹配元素的数目用于指示为所述目标调色板能够在所 述调色板模板中找到匹配元素的个数。  In another embodiment, when the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determining the palette All matching elements of the corresponding position indicated by the first index information in the template constitute a set of matching elements in the palette template, wherein the matching elements in the set of matching elements in the palette template The number is used to indicate the number of matching elements that can be found in the palette template for the target palette.
在另一实施方式中,当所述元素预测标识为所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目, 且所述数目大于或等于 1 , 依次确 定所述调色板模板中由所述第二索引信息指示的对应位置的匹配元素,所 确定的全部所述匹配元素构成所述调色板模板中的匹配元素的集合。  In another embodiment, when the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determining the coloring in sequence A matching element of a corresponding position indicated by the second index information in the board template, all of the determined matching elements constitute a set of matching elements in the palette template.
此外, 当预测信息同时包括预测指示信息与元素预测标识时, 仅在预 测指示信息指示目标调色板进行预测处理的情况下,才需要从码流中获取 元素预测标识。  Further, when the prediction information includes both the prediction indication information and the element prediction flag, it is only necessary to acquire the element prediction flag from the code stream if the prediction indication information indicates that the target palette performs prediction processing.
以下结合具体实施例详细描述根据本发明实施例的如何确定匹配元 素。  How to determine a matching element according to an embodiment of the present invention will be described in detail below with reference to specific embodiments.
若所述元素预测标识是调色板模板中元素的预测标识,则当调色板模 板中某一元素的元素预测标识指示该元素为目标调色板的第一类元素的 匹配元素时,可确定调色板模板中该元素为目标调色板中某一第一类元素 在调色板模板中的匹配元素。 例如, 调色板模板中元素的数目为 8, 8个 元素分别为 ( 62, 89, 110, 128, 154, 189, 205, 240 ), 所述元素预测 标识可以是 ( 0, 0, 0, 1, 1, 0, 1, 0), 0 指示调色板模板中的该元素 不作为匹配元素, 1指示调色板模板中的该元素作为匹配元素。 对于调色 板模板中元素 62, 89, 110, 189和 240, 它们对应的元素预测标识为 0, 指示它们作为非匹配元素, 对于调色板模板中元素 128, 154和 205, 它 们对应的元素预测标识为 1, 指示它们作为匹配元素。 通过所述元素预测 标识, 可以确定 128, 154和 205作为目标调色板中目标元素在调色板模 板中的匹配元素。 或者, 所述元素预测标识为 ( 0, 0, 0, 0, 0, 0, 0, 0) 时, 表示在调色板模板中不存在匹配元素的集合。 If the element prediction identifier is a predicted identifier of an element in the palette template, then when the palette mode When the element predictive identifier of an element in the board indicates that the element is a matching element of the first type of element of the target palette, it may be determined that the element in the palette template is a first type of element in the target palette. Matching elements in the swatch template. For example, the number of elements in the palette template is 8, and the eight elements are (62, 89, 110, 128, 154, 189, 205, 240), and the element prediction identifier may be (0, 0, 0, 1, 1, 0, 1, 0), 0 indicates that the element in the palette template is not a matching element, and 1 indicates that the element in the palette template is a matching element. For elements 62, 89, 110, 189 and 240 in the palette template, their corresponding element prediction ID is 0, indicating that they are non-matching elements, and for elements 128, 154 and 205 in the palette template, their corresponding elements The prediction ID is 1, indicating that they are matching elements. Through the element prediction identifier, 128, 154, and 205 can be determined as matching elements of the target element in the palette template in the target palette. Alternatively, when the element prediction identifier is (0, 0, 0, 0, 0, 0, 0, 0), it indicates that there is no set of matching elements in the palette template.
若所述预测标识是目标调色板中元素的元素预测标识,则当目标调色 板中某一目标元素的元素预测标识指示该目标元素能够在调色板模板中 找到其匹配元素时, 还需要进一步从码流中获取第二索引信息, 并根据该 第二索引信息确定所述匹配元素在调色板模板中位置,或等价的确定所述 匹配元素。 例如, 在目标调色板中目标元素的数目为 6的情况下, 所述元 素预测标识可以是 ( 1, 0, 0, 0, 1, 1 )。 其中, 0 指示目标调色板中该 目标元素不能够在调色板模板中找到其匹配元素, 即是第二类元素; 1指 示目标调色板中该目标元素能够在调色板模板中找到其匹配元素,即是第 一类元素。对于元素预测标识为 1的目标调色板中的第一类元素, 其第二 索引信息分别为 4, 3, 6。 调色板模板的元素的数目为 8, 8个元素分别 为 ( 62, 89, 110, 128, 154, 189, 205, 240 )。 此时, 可根据该第二索 引信息, 确定目标调色板中目标元素中第 1、 5、 6个在调色板模板中的匹 配元素分别是 154, 128和 205。 或者, 所述元素预测标识为 ( 0, 0, 0, 0, 0, 0) 时, 表示在调色板模板中不存在与目标调色板的目标元素匹配 的匹配元素, 即目标调色板中不存在第一类元素, 而仅存在第二类元素。  If the prediction identifier is an element prediction identifier of an element in the target palette, when an element prediction identifier of a target element in the target palette indicates that the target element can find its matching element in the palette template, The second index information needs to be further obtained from the code stream, and the location of the matching element in the palette template is determined according to the second index information, or the matching element is equivalently determined. For example, in the case where the number of target elements in the target palette is 6, the element prediction flag may be (1, 0, 0, 0, 1, 1). Where 0 indicates that the target element in the target palette cannot find its matching element in the palette template, that is, the second type of element; 1 indicates that the target element in the target palette can be found in the palette template Its matching element is the first type of element. For the first type of element in the target palette with the element prediction identifier of 1, the second index information is 4, 3, and 6, respectively. The number of elements in the palette template is 8, 8 elements are (62, 89, 110, 128, 154, 189, 205, 240). At this time, according to the second index information, it is determined that the matching elements of the first, fifth, and sixth target elements in the target palette are 154, 128, and 205, respectively. Or, when the element prediction identifier is (0, 0, 0, 0, 0, 0), it means that there is no matching element matching the target element of the target palette in the palette template, that is, the target palette The first type of element does not exist, and only the second type of element exists.
若元素预测标识是调色板模板中所述匹配元素的集合中所述匹配元 素的数目, 则当元素预测标识指示调色板模板中匹配元素的数目不为 0 时, 需要进一步从码流中获取第二索引信息, 并根据该第二索引信息确定 匹配元素在调色板模板中位置, 或等价地确定所述匹配元素。 例如, 获得 的调色板模板中匹配元素的数目为 3 , 指示目标调色板中有 3个目标元素 在调色板模板中能找到匹配元素。 调色板模板的元素的数目为 8 , 8个元 素分别为 ( 62 , 89 , 1 1 0 , 128 , 154 , 189 , 205 , 240 )。 获取的 3个第二 索引信息分别为 4 , 3 , 6。 此时, 可根据该第二索引信息, 确定目标调色 板中的目标元素在调色板模板中的匹配元素分别是 154 , 128和 205。 If the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, when the element prediction identifier indicates that the number of matching elements in the palette template is not 0 The second index information needs to be further obtained from the code stream, and the position of the matching element in the palette template is determined according to the second index information, or the matching element is equivalently determined. For example, the number of matching elements in the obtained palette template is 3, indicating that there are 3 target elements in the target palette to find matching elements in the palette template. The number of elements in the palette template is 8, and the eight elements are (62, 89, 1 1 0, 128, 154, 189, 205, 240). The obtained three second index information are 4, 3, and 6, respectively. At this time, according to the second index information, it is determined that the matching elements of the target element in the target palette in the palette template are 154, 128, and 205, respectively.
S 1 3 , 根据所述预测信息与所述匹配元素的集合, 确定所述目标元素 的集合。  S 1 3 , determining a set of the target elements according to the prediction information and the set of matching elements.
在一种实施方式中,对于所述元素预测标识为所述调色板模板的预测 标识的情况, 当在 S 12步骤中确定的所述匹配元素的集合为非空, 所述预 测信息还包括第一预测位置信息,于是当所述匹配元素的集合中匹配元素 的个数少于所述目标元素的集合中目标元素的个数,所述根据所述预测信 息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调 色板模板的预测标识、 所述第一预测位置信息和所述匹配元素的集合, 确 定所述目标元素的集合中的所述至少一个第一类元素的数值和位置;从所 述目标图像块的码流中获取所述目标元素的集合中的所述至少一个第二 类元素的数值。  In an embodiment, for the case where the element prediction identifier is the prediction identifier of the palette template, when the set of the matching elements determined in step S12 is non-empty, the prediction information further includes a first predicted location information, where the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, according to the prediction information and the set of matching elements, Determining the set of the target elements, including: determining, according to the predicted identifier of the palette template, the first predicted location information, and the set of matching elements, the at least one of the set of target elements A value and a position of a class of elements; a value of the at least one second class element in the set of the target elements is obtained from a code stream of the target image block.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述元素预测标识、 所述第一预测 位置信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少 一个第一类元素的数值和位置。  Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. The collecting, comprising: determining a value and a location of the at least one first type element in the set of the target elements according to the element prediction identifier, the first predicted location information, and the set of matching elements.
或者, 当所述匹配元素的集合为非空, 当所述匹配元素的集合中匹配 元素的个数少于或等于所述目标元素的集合中目标元素的个数,所述根据 所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照预定方式 (例如数值大小的升序或降序排列), 根据所述元素预测标 识和所述匹配元素的集合,确定所述目标元素的集合中全部所述目标元素 的数值及其位置。 此外, 所述预测信息还可以包括第一预测差值信息, 所述根据所述元 素预测标识、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目 标元素的集合中的所述至少一个第一类元素, 包括: 根据所述第一预测差 值信息, 调整所述目标元素的集合中的所述至少一个第一类元素的数值。 Or when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, according to the prediction information And determining, by the set of the matching elements, the set of the target elements, including: determining the target according to the set of element prediction identifiers and the matching elements according to a predetermined manner (eg, ascending or descending order of numerical values) The value of all of the target elements in the collection of elements and their locations. In addition, the prediction information may further include first prediction difference information, where the determining, according to the element prediction identifier, the first predicted location information, and the set of matching elements, determining a location in the set of target elements The at least one first type of element includes: adjusting a value of the at least one first type element in the set of the target elements according to the first predicted difference information.
在另一实施方式中,在所述元素预测标识为所述调色板模板中元素的 预测标识的情况下, 当在步骤 S 1 2中确定的所述匹配元素的集合为非空, 所述预测信息还包括第二预测位置信息,当所述匹配元素的集合中匹配元 素的个数少于所述目标元素的集合中目标元素的个数,所述根据所述预测 信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述 调色板模板中元素的预测标识、所述第二预测位置信息和所述匹配元素的 集合,确定所述目标元素的集合中的所述至少一个第一类元素的数值和位 置;从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。  In another embodiment, where the element prediction identifier is a predicted identifier of an element in the palette template, when the set of matching elements determined in step S12 is non-empty, The prediction information further includes second predicted location information, when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, according to the prediction information and the matching element And determining a set of the target elements, including: determining, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of matching elements, in the set of the target elements a value and a position of the at least one first type element; obtaining a value of the at least one second type element in the set of the target elements from a code stream of the target image block.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合,包括:根据所述调色板模板中元素的预测标识、 所述第二预测位置信息和所述匹配元素的集合,确定所述目标元素的集合 中的所述至少一个第一类元素。  Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And the determining includes: determining, according to the predicted identifier of the element in the palette template, the second predicted location information, and the set of matching elements, the at least one first class element in the set of the target elements.
或者, 当所述匹配元素的集合为非空, 当所述匹配元素的集合中匹配 元素的个数少于或等于所述目标元素的集合中目标元素的个数,所述根据 所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数值大小的升序或降序排列,根据所述元素预测标识和所述匹配元素 的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。  Or when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, according to the prediction information And determining, by the set of the matching elements, the set of the target elements, including: sorting in ascending or descending order according to a numerical size, determining, according to the element prediction identifier and the set of matching elements, all of the set of the target elements The value of the target element and its location.
此外, 预测信息还包括第二预测差值信息, 所述根据所述调色板模板 中元素的预测标识、 所述第二预测位置信息和所述匹配元素的集合, 确定 所述目标元素的集合中的所述至少一个第一类元素, 包括: 根据所述第二 预测差值信息,调整所述目标元素的集合中的所述至少一个第一类元素的 数值。  Furthermore, the prediction information further includes second prediction difference information, the determining the set of the target elements according to the prediction identifier of the element in the palette template, the second predicted location information, and the set of matching elements. The at least one first type element in the method, comprising: adjusting a value of the at least one first type element in the set of the target elements according to the second predicted difference information.
例如,可以将所述匹配元素作为目标调色板中对应的第一类元素的预 测值。 此时还从码流中获取第二预测差值信息。 例如, 目标调色板中第一 类元素的匹配元素为 86 ,获取的第二预测差值信息包括预测差值绝对值 3 以及预测差值符号 0 , 那么可以确定其该预测差值为 - 3 , 并进一步确定目 标调色板中该第一类元素为 86+ (- 3) =83。 For example, the matching element can be used as a pre-corresponding first element in the target palette. Measured value. At this time, the second predicted difference information is also obtained from the code stream. For example, the matching element of the first type element in the target palette is 86, and the obtained second predicted difference information includes the absolute value of the prediction difference 3 and the predicted difference symbol 0, then it can be determined that the predicted difference is -3 And further determine that the first type of element in the target palette is 86+ (- 3) =83.
在另一实施方式中,在所述元素预测标识为所述目标调色板的预测标 识的情况下,当在步骤 S 12中确定的所述匹配元素的集合中匹配元素的个 数少于所述目标元素的集合中目标元素的个数,所述根据所述预测信息与 所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述目标调 色板的预测标识、 所述第一索引信息和所述匹配元素的集合, 确定所述目 标元素的集合中的所述至少一个第一类元素的数值和位置;从所述目标图 像块的码流中获取所述目标元素的集合中的所述至少一个第二类元素的 数值。  In another embodiment, in a case where the element prediction identifier is a prediction identifier of the target palette, the number of matching elements in the set of matching elements determined in step S12 is less than Determining the number of the target elements in the set of the target elements, the determining the set of the target elements according to the prediction information and the set of the matching elements, including: according to the prediction identifier of the target color palette, a first index information and a set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; acquiring the target element from a code stream of the target image block The value of the at least one second type element in the collection.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述目标调色板的预测标识、 所述 第一索引信息和所述匹配元素的集合,确定所述目标元素的集合中的所述 至少一个第一类元素的数值和位置。  Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And determining, according to the prediction identifier of the target palette, the first index information, and the set of matching elements, determining a value and a location of the at least one first type element in the set of target elements .
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数,所述根据所述预测信息与所述匹配元素的 集合,确定所述目标元素的集合, 包括:按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合 中全部目标元素的数值及其位置。  Or determining, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, determining, according to the prediction information and the set of matching elements, The set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
此外, 所述预测信息还包括第一预测差值信息, 所述根据所述目标调 色板的预测标识、 所述第一索引信息和所述匹配元素的集合, 确定所述目 标元素的集合中的所述至少一个第一类元素, 包括: 根据所述第一预测差 值信息, 调整所述目标元素的集合中的所述至少一个第一类元素的数值。  In addition, the prediction information further includes first prediction difference information, where the determining, according to the prediction identifier of the target palette, the first index information, and the set of matching elements, determining the set of target elements The at least one first type of element, comprising: adjusting a value of the at least one first type element in the set of target elements according to the first predicted difference information.
在另一实施方式中,在所述元素预测标识为所述目标调色板中元素的 预测标识的情况下 ,所述在步骤 S 12中确定的匹配元素的集合中匹配元素 的个数少于所述目标元素的集合中目标元素的个数,所述根据所述预测信 息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述目 标调色板中元素的预测标识、 所述第二索引信息和所述匹配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和位置;从 所述目标图像块的码流中获取所述目标元素的集合中的所述至少一个第 二类元素的数值。 In another embodiment, in the case that the element prediction identifier is a predicted identifier of an element in the target palette, the number of matching elements in the set of matching elements determined in step S12 is less than The number of target elements in the set of target elements, according to the predicted letter And determining, by the set of the matching elements, the set of the target elements, including: determining the target according to the predicted identifier of the element in the target palette, the second index information, and the set of the matching elements a value and a location of the at least one first class element in the set of elements; obtaining a value of the at least one second class element of the set of target elements from a code stream of the target image block.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合,包括:根据所述目标调色板中元素的预测标识、 所述第二索引信息和所述匹配元素的集合,确定所述目标元素的集合中的 所述至少一个第一类元素的数值和位置。  Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And determining, according to the prediction identifier of the element in the target color palette, the second index information, and the set of the matching elements, determining a value of the at least one first type element in the set of the target elements And location.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数,所述根据所述预测信息与所述匹配元素的 集合,确定所述目标元素的集合, 包括:按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合 中全部目标元素的数值及其位置。  Or determining, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, determining, according to the prediction information and the set of matching elements, The set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
此外, 所述预测信息还包括第二预测差值信息, 所述根据所述目标调 色板中元素的预测标识、 所述第二索引信息和所述匹配元素的集合, 确定 所述目标元素的集合中的所述至少一个第一类元素, 包括: 根据所述第二 预测差值信息,调整所述目标元素的集合中的所述至少一个第一类元素的 数值。  In addition, the prediction information further includes second prediction difference information, where the determining the target element according to the prediction identifier of the element in the target palette, the second index information, and the set of matching elements The at least one first class element in the set, comprising: adjusting a value of the at least one first class element in the set of the target elements according to the second predicted difference information.
在另一实施方式中,在所述元素预测标识为所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目的情况下,所述预测信息还包括第一 预测位置信息,当在步骤 S 1 2中确定的所述匹配元素的集合中匹配元素的 个数少于所述目标元素的集合中目标元素的个数,所述根据所述预测信息 与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色 板模板中所述匹配元素的集合中所述匹配元素的数目、所述第一预测位置 信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个 第一类元素的数值和位置;从所述目标图像块的码流中获取所述目标元素 的集合中的所述至少一个第二类元素的数值。 或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板模板中所述匹配元素的 集合中所述匹配元素的数目、所述第一预测位置信息和所述匹配元素的集 合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和位 置。 In another embodiment, where the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, the prediction information further includes first predicted location information, And when the number of matching elements in the set of matching elements determined in step S12 is less than the number of target elements in the set of the target elements, the set according to the prediction information and the matching element Determining the set of the target elements, including: determining, according to the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements And a value of the at least one first type element in the set of target elements; and a value of the at least one second type element in the set of the target elements is obtained from a code stream of the target image block. Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And determining, according to the set of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the set of matching elements, determining the set of the target elements The value and location of the at least one first type of element.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数,所述根据所述预测信息与所述匹配元素的 集合,确定所述目标元素的集合, 包括:按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合 中全部目标元素的数值及其位置。  Or determining, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, determining, according to the prediction information and the set of matching elements, The set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
此外, 所述预测信息还包括第一预测差值信息, 所述根据所述调色板 模板中所述匹配元素的集合中所述匹配元素的数目、所述第一预测位置信 息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第 一类元素, 包括: 根据所述第一预测差值信息, 调整所述目标元素的集合 中的所述至少一个第一类元素的数值。  Furthermore, the prediction information further includes first prediction difference information, the number of the matching elements in the set of matching elements in the palette template, the first predicted location information, and the matching a set of the elements, the determining the at least one first type element in the set of the target elements, comprising: adjusting the at least one first category in the set of the target elements according to the first predicted difference information The value of the element.
在另一实施方式中,在所述元素预测标识为所述调色板模板中所述匹 配元素的集合中所述匹配元素的数目的情况下,所述预测信息还包括第二 预测位置信息,当在步骤 S 1 2中确定的所述匹配元素的集合中匹配元素的 个数少于所述目标元素的集合中目标元素的个数,所述根据所述预测信息 与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色 板模板中所述匹配元素的集合中所述匹配元素的数目、所述第二预测位置 信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个 第一类元素的数值和位置;从所述目标图像块的码流中获取所述目标元素 的集合中的所述至少一个第二类元素的数值。  In another embodiment, where the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, the prediction information further includes second predicted location information, And when the number of matching elements in the set of matching elements determined in step S12 is less than the number of target elements in the set of the target elements, the set according to the prediction information and the matching element Determining the set of the target elements, including: determining, according to the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the set of matching elements, And a value of the at least one first type element in the set of target elements; and a value of the at least one second type element in the set of the target elements is obtained from a code stream of the target image block.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 根据所述调色板模板中所述匹配元素的 集合中所述匹配元素的数目、所述第二预测位置信息和所述匹配元素的集 合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和位 置。 Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, determining the target element according to the prediction information and the set of matching elements. And the set includes: a set of the matching elements in the set of matching elements in the palette template, the second predicted location information, and a set of the matching elements And determining a value and a location of the at least one first class element in the set of the target elements.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数,所述根据所述预测信息与所述匹配元素的 集合,确定所述目标元素的集合, 包括:按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配元素的集合,确定所述目标元素的集合 中全部目标元素的数值及其位置。  Or determining, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, determining, according to the prediction information and the set of matching elements, The set of target elements includes: sorting in ascending or descending order of numerical values, and determining values of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
此外, 所述预测信息还包括第二预测差值信息, 所述根据所述调色板 模板中所述匹配元素的集合中所述匹配元素的数目、所述第二预测位置信 息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第 一类元素, 包括: 根据所述第二预测差值信息, 调整所述目标元素的集合 中的所述至少一个第一类元素的数值。  Furthermore, the prediction information further includes second prediction difference information, the number of the matching elements in the set of matching elements in the palette template, the second predicted location information, and the matching And determining, by the set of the at least one first class element in the set of the target elements, the: adjusting, according to the second predicted difference information, the at least one first class in the set of the target elements The value of the element.
为了确定目标元素的集合,在确定目标调色板的所有目标元素的数值 后, 需要确定目标调色板中各个目标元素的位置。 例如, 可根据给定次序 对目标调色板所有目标元素进行排序以确定目标调色板中各个目标元素 的位置。 例如, 可以按照目标元素的数值的大小, 对目标调色板中各个目 标元素进行升序或降序排列, 以确定各目标元素的位置。  In order to determine the set of target elements, after determining the values of all the target elements of the target palette, it is necessary to determine the position of each target element in the target palette. For example, all target elements of the target palette can be sorted according to a given order to determine the position of each target element in the target palette. For example, each target element in the target palette can be sorted in ascending or descending order according to the value of the target element to determine the position of each target element.
例如, 当所述匹配元素的集合为非空, 且所述匹配元素的集合中匹配 元素的个数等于所述目标元素的集合中目标元素的个数,所述根据所述预 测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数 值大小的升序或降序排列, 根据所述元素预测标识和所述匹配元素的集 合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 即将所述 匹配元素的集合中的匹配元素按照升序或降序进行排列,以确定目标元素 的集合中目标元素的数值和位置。  For example, when the set of matching elements is non-empty, and the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, according to the prediction information and the And determining, by the set of matching elements, the set of the target elements, including: sorting in ascending or descending order according to a numerical value, determining, according to the element prediction identifier and the set of matching elements, determining all target elements in the set of the target elements The value and its location. The matching elements in the set of matching elements are arranged in ascending or descending order to determine the value and position of the target element in the set of target elements.
或者, 当所述匹配元素的集合为非空, 且所述匹配元素的集合中匹配 元素的个数少于所述目标元素的集合中目标元素的个数,所述根据所述预 测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 按照数 值大小的升序或降序排列, 根据所述元素预测标识和所述匹配元素的集 合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 即, 除了 确定的匹配元素的集合之外, 还需要从码流中获取全部第二类元素, 并将 匹配元素的集合与全部的第二类元素,按照升序或降序排列, 以确定目标 元素的集合中目标元素的数值和位置。 Or, when the set of matching elements is non-empty, and the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, according to the prediction information and the Determining a set of matching elements, determining the set of the target elements, comprising: arranging in ascending or descending order according to a numerical size, determining, according to the element prediction identifier and the set of matching elements, all target elements in the set of the target elements The value and its location. That is, except In addition to the determined set of matching elements, all second type elements need to be obtained from the code stream, and the set of matching elements and all the second type elements are arranged in ascending or descending order to determine the target in the set of target elements. The value and position of the element.
也可根据第一或第二预测位置信息,对目标调色板所有目标元素进行 排序, 以确定目标调色板中各个目标元素的位置。 下面举例说明, 如何根 据预测位置信息确定目标元素在所述目标元素的集合中的位置。  All target elements of the target palette may also be sorted according to the first or second predicted position information to determine the position of each target element in the target palette. The following is an example of how to determine the location of a target element in the set of target elements based on the predicted location information.
在一种可能的实施方式中,若所述元素预测标识是调色板模板中元素 的预测标识,则当调色板模板中某一元素的元素预测标识指示该元素为目 标调色板的元素的匹配元素时,可确定调色板模板中该元素为目标调色板 中某一目标元素在调色板模板中的匹配元素,此时可以从码流中获取目标 调色板中被匹配元素的位置信息。对于目标调色板中未被匹配元素,从码 流中获取后可按照给定顺序填充目标调色板, 例如, 调色板模板元素数目 为 8, 8个元素分别为 ( 62, 89, 110, 128, 154, 189, 205, 240 ), 所述 元素预测标识可以是 ( 0, 0, 0, 1, 1, 0, 1, 0 ), 0 指示调色板模板中 元素不作为匹配元素, 1指示调色板模板元素作为匹配元素。 对于调色板 模板中元素 62, 89, 110, 189和 240, 它们对应的元素预测标识为 0, 指 示它们不作为匹配元素, 对于调色板模板中元素 128, 154和 205, 它们 对应的元素预测标识为 1, 指示它们作为匹配元素, 此时可以获取目标调 色板中被匹配元素的预测位置信息,例如所获取的这三个元素的位置信息 分别为 ( 0, 4, 5)。 假设目标调色板中有六个目标元素。 则根据按照前面 步骤确定的三个目标元素的数值以及三个目标元素的位置能够确定目标 调色板为 ( 128, UN, UN, UN, 154, 205 ), UN表示剩余未被确定的元素。 接着从码流获取这三个未被确定的目标元素,例如获取的三个目标元素为 200, 155和 202, 并放置到目标调色板的空余位置。 可按照预先设定的规 则将从码流中获取的元素放置到目标调色板中。例如可以按照从前到后的 次序放置, 确定目标调色板为 ( 128, 200, 155, 202, 154, 205 )。  In a possible implementation manner, if the element prediction identifier is a predicted identifier of an element in a palette template, when an element of the palette template predicts an element indicating that the element is an element of the target palette When matching elements, it can be determined that the element in the palette template is a matching element of a target element in the palette template in the target palette, and the matched element in the target palette can be obtained from the code stream. Location information. For the unmatched elements in the target palette, the target palette can be filled in the given order after being acquired from the code stream. For example, the number of palette template elements is 8, and 8 elements are respectively (62, 89, 110 , 128, 154, 189, 205, 240), the element prediction identifier may be (0, 0, 0, 1, 1, 0, 1, 0), 0 indicates that the element in the palette template is not a matching element, 1 indicates a palette template element as a matching element. For elements 62, 89, 110, 189 and 240 in the palette template, their corresponding element prediction ID is 0, indicating that they are not matching elements, and for elements 128, 154 and 205 in the palette template, their corresponding elements The prediction identifier is 1, indicating that they are matching elements. At this time, the predicted position information of the matched elements in the target palette can be obtained. For example, the obtained position information of the three elements is (0, 4, 5). Suppose there are six target elements in the target palette. Based on the values of the three target elements determined according to the previous steps and the positions of the three target elements, the target palette can be determined as (128, UN, UN, UN, 154, 205), and UN represents the remaining undetermined elements. The three undetermined target elements are then retrieved from the code stream, for example, the three target elements acquired are 200, 155, and 202, and placed in a vacant position of the target palette. Elements acquired from the code stream can be placed into the target palette according to pre-defined rules. For example, you can place them in order from front to back, and make sure the target palette is (128, 200, 155, 202, 154, 205).
在另一可能的实施方式中,若所述元素预测标识是调色板模板中匹配 元素的数目, 则当预测标识指示调色板模板中匹配元素的数目不为 0时, 需要进一步从码流中获取索引信息,所述索引信息的数目为所述预测标识 指示的调色板模板中匹配元素的数目。可以根据该索引信息确定匹配元素 在调色板模板中位置, 或等价地确定所述匹配元素, 此时还可以从码流中 获取匹配元素的预测位置信息,对于目标调色板中未被匹配元素, 从码流 中获取后可按照给定顺序填充目标调色板。 例如, 获得的调色板模板中匹 配元素的数目为 3, 指示目标调色板中有 3个元素在调色板模板中能找到 匹配元素。调色板模板元素数目为 8, 8个元素分别为( 62, 89, 110, 128, 154, 189, 205, 240 )。 获取的 3个索引信息为 3, 4, 6, 此时, 可根据 该索引信息, 目标调色板中元素在调色板模板中的匹配元素分别是 128, 154和 205。 此时可以获取目标调色板中被匹配元素的预测位置信息, 例 如所获取的这三个元素的位置信息分别为 ( 0, 4, 5 ), 假设目标调色板中 有六个元素。则根据按照前面步骤确定的三个目标元素的数值以及三个目 标元素的位置能够确定目标调色板为 ( 128, UN, UN, UN, 154, 205 ), UN 表示剩余未被确定的元素。 接着从码流获取这三个未被确定的目标元素, 例如获取的三个目标元素为 200, 155和 202, 并放置到目标调色板的空 余位置。可按照预先设定的规则将从码流中获取的目标元素放置到目标调 色板中。 例如可以按照从前到后的次序放置, 确定目标调色板为 ( 128, 200, 155, 202, 154, 205 )。 In another possible implementation manner, if the element prediction identifier is the number of matching elements in the palette template, when the predicted identifier indicates that the number of matching elements in the palette template is not 0, further from the code stream is needed. Obtaining index information, the number of the index information being the prediction identifier The number of matching elements in the indicated palette template. The position of the matching element in the palette template may be determined according to the index information, or the matching element may be equivalently determined. At this time, the predicted position information of the matching element may also be obtained from the code stream, and the target palette is not Matching elements, obtained from the stream, can populate the target palette in the given order. For example, the number of matching elements in the obtained palette template is 3, indicating that 3 elements in the target palette can find matching elements in the palette template. The number of palette template elements is 8, and the eight elements are (62, 89, 110, 128, 154, 189, 205, 240). The obtained three index information is 3, 4, 6. At this time, according to the index information, the matching elements of the elements in the target palette in the palette template are 128, 154, and 205, respectively. At this time, the predicted position information of the matched elements in the target palette can be obtained. For example, the obtained position information of the three elements is (0, 4, 5), respectively, and it is assumed that there are six elements in the target palette. Then, according to the values of the three target elements determined according to the previous steps and the positions of the three target elements, the target palette can be determined as (128, UN, UN, UN, 154, 205), and UN represents the remaining undetermined elements. The three undetermined target elements are then retrieved from the code stream, for example, the three target elements acquired are 200, 155, and 202, and placed in a vacant position of the target palette. The target elements obtained from the code stream can be placed into the target palette according to a predetermined rule. For example, it can be placed in order from front to back, and the target palette is determined to be (128, 200, 155, 202, 154, 205).
S14, 依据所述目标元素的集合, 对所述目标图像块进行解码。  S14. Decode the target image block according to the set of the target elements.
在确定目标调色板的目标元素的集合之后,也就相当于确定了目标调 色板。 下面可使用目标调色板对目标图像块的对应信号分量进行解码操 作。  After determining the set of target elements of the target palette, it is equivalent to determining the target palette. The target palette can be used to decode the corresponding signal components of the target image block.
解析目标图像块的信号分量的索引表,并且可使用已有技术中方法执 行该解析操作。  An index table of signal components of the target image block is parsed, and the parsing operation can be performed using methods in the prior art.
使用解析得到的索引表从目标调色板中索引得到目标图像块所述信 号分量中每个釆样点的重建值。 具体说, 对于目标块的一个釆样点, 找到 索引表相应位置的索引值。 用该索引值索引目标调色板, 将索引到的目标 调色板中的元素数值作为所述釆样点的重建值。对目标图像块中的所有釆 样点执行相同操作, 即可获得目标图像块所有釆样点的重建值。对于重建 的目标图像块,后续可以使用去块效应滤波器等对重建图像块进行滤波操 作。 The reconstructed value of each of the signal components in the target image block is obtained by indexing from the target palette using the parsed index table. Specifically, for a sample point of the target block, find the index value of the corresponding position of the index table. The target palette is indexed by the index value, and the value of the element in the target palette indexed is used as the reconstructed value of the sample point. Perform the same operation on all the sample points in the target image block to obtain the reconstructed values of all the sample points of the target image block. For the reconstructed target image block, the reconstructed image block can be subsequently filtered using a deblocking filter or the like. Work.
对目标图像块中的所有信号分量可执行相似的解码操作。  A similar decoding operation can be performed on all signal components in the target image block.
由此可见,本发明实施例通过例如预测信,包、对目标调色板进行预 'J编 码, 以减少目标调色板的编码开销, 从而进一步提高釆用调色板编码模式 的视频图像的压缩效率。  It can be seen that the embodiment of the present invention further reduces the coding overhead of the target palette by, for example, predicting a message, a packet, and pre-coding the target color palette, thereby further improving the video image of the palette color coding mode. Compression efficiency.
此外, 在根据所述预测信息, 确定在所述调色板模板中的匹配元素的 集合之前, 还包括预设调色板模板。  Further, before determining the set of matching elements in the palette template according to the prediction information, a preset palette template is further included.
在根据所述预测信息与所述匹配元素的集合,确定所述目标元素的集 合之后,还包括根据所述目标元素的集合中的所述目标元素以及所述调色 板模板中的所述匹配元素对应的计数器数值, 更新所述调色板模板。  After determining the set of the target elements according to the prediction information and the set of matching elements, further comprising: matching the target elements in the set of target elements and the matching in the palette template The counter value corresponding to the element, the palette template is updated.
例如, 利用所述目标调色板中的所述至少一个第二类元素, 更新所述 调色板模板中所述非匹配元素的集合;利用所述目标调色板中的所述目标 元素, 更新所述调色板模板中与元素对应的计数器数值。  For example, updating, by the at least one second class element in the target palette, a set of the non-matching elements in the palette template; utilizing the target element in the target palette, Update the counter value corresponding to the element in the palette template.
在处理完目标图像块之后, 需要更新调色板模板进行。 可为调色板模 板中的每个元素使用一个计数器,此计数器根据该元素的出现次数以及该 元素在调色板模板中的存在时长进行更新。调色板模板可根据其中元素的 计数器数值以及目标调色板中的元素进行更新。  After the target image block is processed, the palette template needs to be updated. A counter can be used for each element in the palette template, which is updated based on the number of occurrences of the element and the length of time the element has been in the palette template. The palette template can be updated based on the counter value of the element and the elements in the target palette.
更新调色板时,首先将调色板模板每个元素计数器数值减小一个预设 值 (比如 1 )。 接着遍历调色板模板中各个元素, 对其中每个元素检查目 标调色板中各个元素,看是否存在一个目标调色板元素能够命中该调色板 模板元素, 若存在, 则将该该调色板模板元素计数器数值增加一个预设值 When updating the palette, first reduce the value of each element counter of the palette template by a preset value (such as 1). Then iterate through the elements in the palette template, check each element in the target palette for each element, and see if there is a target palette element that can hit the palette template element. If it exists, then adjust the element. Swatch template element counter value is incremented by a preset value
(比如 3 )。所述命中指两个元素数值之差的绝对值在一预设范围(比如 3 ) 内。按给定次序遍历目标调色板中各新元素, 并将该新元素插入调色板模 板中。 所述新元素指目标调色板中没有命中调色板模板中任一元素的元 素。所述将新元素插入调色板模板中指查找调色板模板中计数器数值最小 的元素, 若该元素计算其数值在一个预设值 (比如 1 ) 以下, 则使用所述 新元素替换该调色板模板元素。若存在多个调色板元素具有相同的最小计 数器数值, 则按照给定次序(例如元素在调色板模板中位置索引从小到大 的次序)选择一个进行替换。 对于刚刚插入调色板模板的元素, 其计数器 数值设为预定初始值 (比如 2 )。 (eg 3). The hit refers to the absolute value of the difference between the values of the two elements within a predetermined range (such as 3). Traverses each new element in the target palette in the given order and inserts the new element into the palette template. The new element refers to an element in the target palette that does not hit any of the elements in the palette template. The inserting a new element into the palette template refers to finding an element with the smallest counter value in the palette template. If the element calculates its value below a preset value (such as 1), the color is replaced by the new element. Board template element. If there are multiple palette elements with the same minimum counter value, then one is selected for replacement in the given order (eg, the order of the elements in the palette template from small to large). For the element just inserted into the palette template, its counter The value is set to a predetermined initial value (such as 2).
例如, 调色板模板中元素的数目为 8, 8个元素分别为( 62, 89, 110, 128, 154, 189, 205, 240 ), 计数器数值为 ( 3, 3, 2, 2, 2, 1, 1, 1 ), 目标调色板中的目标元素分别为 ( 70, 128, 154, 205, 255 )。 更新调色 板时, 首先将调色板模板所有元素计数器的值减 1, 此时计数器状态变为 ( 2, 2, 1, 1, 1, 0, 0, 0)。 检查发现调色板模板中元素 128, 154, 205 被目标调色板中元素命中, 元素 128, 154, 205的计数器数值增加 2。 计 数器状态变为 ( 2, 2, 1, 4, 4, 0, 3, 0)。  For example, the number of elements in the palette template is 8, 8 elements are (62, 89, 110, 128, 154, 189, 205, 240), and the counter value is (3, 3, 2, 2, 2, 1, 1, 1), the target elements in the target palette are (70, 128, 154, 205, 255). When updating the palette, first reduce the value of all element counters of the palette template by 1, and the counter status changes to ( 2, 2, 1, 1, 1, 0, 0, 0). Check that the elements 128, 154, 205 in the palette template are hit by the elements in the target palette, and the counter values of elements 128, 154, 205 are incremented by 2. The counter status changes to ( 2, 2, 1, 4, 4, 0, 3, 0).
对于目标调色板中元素 70和 255, 这两个目标元素没有命中调色板 模板任一匹配元素。 当前调色板模板中最小计数器数值为 0, 对应的调色 板模板元素为 240和 189。 元素 189在调色板模板中的位置索引较小, 所 以将可用 70替换 189, 同时将元素 70的计数器数值设为 2, 调色板模板 变为 ( 62, 89, 110, 128, 154, 70, 205, 240 ), 计数器状态变为 ( 2, 2, 1, 4, 4, 2, 3, 0)。 对于元素 255, 当前调色板模板中计数器数值为 0 , 其对应的调色板模板匹配元素为 240, 因此使用用 255替换 240, 同时将 元素 255的计数器数值设为 2, 此时调色板模板变为 ( 62, 89, 110, 128, 154, 70, 205, 255 ), 计数器状态变为 ( 2, 2, 1, 4, 4, 2, 3, 2)。 至 此, 目标调色板更新完成。  For elements 70 and 255 in the target palette, these two target elements do not hit any matching elements of the palette template. The minimum counter value in the current palette template is 0, and the corresponding palette template elements are 240 and 189. The position index of element 189 in the palette template is small, so 189 can be replaced with 70, while the counter value of element 70 is set to 2, and the palette template becomes (62, 89, 110, 128, 154, 70). , 205, 240 ), the counter status changes to ( 2, 2, 1, 4, 4, 2, 3, 0). For element 255, the counter value in the current palette template is 0, and the corresponding palette template matching element is 240, so use 240 to replace 240, and set the counter value of element 255 to 2, then the palette The template changes to ( 62, 89, 110, 128, 154, 70, 205, 255 ) and the counter status changes to ( 2, 2, 1, 4, 4, 2, 3, 2). At this point, the target palette update is complete.
由上可知,本发明实施例通过例如预测信,包、对目标调色板进行预 'J编 码, 以减少目标调色板的编码开销, 从而进一步提高釆用调色板编码模式 的视频图像的压缩效率。  As can be seen from the above, the embodiment of the present invention further reduces the coding overhead of the target palette by, for example, predicting a message, a packet, and pre-coding the target color palette, thereby further improving the video image of the palette color coding mode. Compression efficiency.
下面,具体结合图 2详细描述根据本发明实施例的目标图像块的编码 方法。  Next, an encoding method of a target image block according to an embodiment of the present invention will be described in detail with reference to Fig. 2 in detail.
S21, 构造目标调色板, 其中所述目标调色板是目标元素的集合, 所 述目标元素的集合中的每个目标元素是基于所述目标图像块的一个信号 分量的釆样点数值确定的具有代表性的数值,其中所述目标元素的集合包 括至少一个第一类元素和 /或至少一个第二类元素, 所述第一类元素是需 要根据调色板模板中的匹配元素确定的目标元素,所述第二类元素无需根 据调色板模板中的匹配元素确定的目标元素。 S 22 , 确定所述目标调色板的预测信息, 并根据所述预测信息对所述 目标调色板进行预测编码,以便确定所述目标调色板中的所述至少一个第 一类元素在所述调色板模板中的匹配元素的集合,其中所述调色板模板由 匹配元素的集合和 /或非匹配元素的集合组成, 所述匹配元素的集合包括 至少一个匹配元素, 所述匹配元素是用于匹配所述第一类元素的元素, 所 述第一类元素的数值与其匹配元素的数值之差的绝对值小于预定值,所述 非匹配元素的集合包括至少一个非匹配元素,所述非匹配元素是无法与所 述第一类元素匹配的元素。 S21. Construct a target palette, where the target palette is a set of target elements, and each target element in the set of target elements is determined based on a sample point value of a signal component of the target image block. a representative value, wherein the set of target elements includes at least one first class element and/or at least one second class element, the first class element being determined according to a matching element in the palette template A target element that does not require a target element determined from matching elements in the palette template. S22, determining prediction information of the target palette, and predictively encoding the target palette according to the prediction information, so as to determine that the at least one first type element in the target palette is a set of matching elements in the palette template, wherein the palette template is composed of a set of matching elements and/or a set of non-matching elements, the set of matching elements including at least one matching element, the matching An element is an element for matching the first type of element, an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value, and the set of the non-matching element includes at least one non-matching element, The non-matching element is an element that cannot match the first type of element.
其中, 所述预测信息可以包括元素预测标识。  The prediction information may include an element prediction identifier.
例如, 元素预测标识为所述调色板模板的预测标识, 其中所述调色板 模板的预测标识用于指示所述调色板模板中的所述匹配元素的集合与所 述非匹配元素的集合。  For example, the element prediction identifier is a predicted identifier of the palette template, wherein the prediction identifier of the palette template is used to indicate a set of the matching elements in the palette template and the non-matching element set.
或者, 元素预测标识为所述调色板模板中元素的预测标识, 其中所述 调色板模板中元素的预测标识用于指示所述调色板模板中所述元素为匹 配元素或非匹配元素。  Or the element prediction identifier is a predicted identifier of the element in the palette template, wherein the predicted identifier of the element in the palette template is used to indicate that the element in the palette template is a matching element or a non-matching element .
或者, 元素预测标识为所述目标调色板的预测标识, 其中所述目标调 色板的预测标识用于指示所述目标元素的集合中的第一类元素和 /或第二 类元素。  Alternatively, the element prediction identifier is a prediction identifier of the target palette, wherein the prediction identifier of the target palette is used to indicate a first type element and/or a second type element in the set of the target elements.
或者, 元素预测标识为所述目标调色板中元素的预测标识, 其中所述 目标调色板中目标元素的预测标识用于指示所述目标元素为第一类元素 或第二类元素。  Alternatively, the element prediction identifier is a predicted identifier of an element in the target palette, wherein the predicted identifier of the target element in the target palette is used to indicate that the target element is a first type element or a second type element.
或者,元素预测标识为所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目,用于指示为所述目标调色板能够在所述调色板模板中找 到匹配元素的个数。  Or the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, used to indicate that a matching element can be found in the palette template for the target palette Number.
可选地, 所述预测信息还包括第一预测位置信息或第二预测位置信 息。  Optionally, the prediction information further includes first predicted location information or second predicted location information.
其中,第一预测位置信息用于指示所述匹配元素的集合分别对应的第 一类元素在所述目标元素的集合中的位置。第二预测位置信息用于指示所 述匹配元素对应的第一类元素在所述目标元素的集合中的位置。 可选地, 预测信息还可以包括第一索引信息或第二索引信息。 The first predicted location information is used to indicate a location of the first type element corresponding to the set of the matching elements in the set of the target elements. The second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of the target element. Optionally, the prediction information may further include first index information or second index information.
其中,第一索引信息用于指示所述匹配元素的集合中全部匹配元素在 所述调色板模板中的对应位置;第二索引信息用于指示所述匹配元素在所 述调色板模板中的对应位置。  The first index information is used to indicate a corresponding position of all matching elements in the set of matching elements in the palette template; the second index information is used to indicate that the matching element is in the palette template. Corresponding location.
可选地, 预测信息还可以包括第一预测差值信息或第二预测差值信 息。  Optionally, the prediction information may further include first predicted difference information or second predicted difference information.
其中,第一预测差值信息用于指示所述目标调色板中所述至少一个第 一类元素中每个第一类元素与其在所述调色板模板中的匹配元素的差值。 第二预测差值信息用于指示所述目标调色板中所述第一类元素与其在所 述调色板模板中的匹配元素的差值。  The first predicted difference information is used to indicate a difference between each of the at least one first type of elements in the target palette and its matching elements in the palette template. The second predicted difference information is used to indicate a difference between the first type of elements in the target palette and their matching elements in the palette template.
可选地, 预测信息还可以包括预测指示信息。  Optionally, the prediction information may further include prediction indication information.
其中,预测指示信息用于指示所述目标调色板中是否存在一个所述第 一类元素能够根据所述预测信息与所述匹配元素的集合而确定。预测指示 信息可以经过对图像预处理得到, 也可以预设为总是釆用调色板预测方 法。  The prediction indication information is used to indicate whether one of the first type of elements in the target palette is determined according to the prediction information and the set of matching elements. The prediction indication information can be obtained by pre-processing the image, or it can be preset to always use the palette prediction method.
S23 , 根据所述预测编码的目标调色板中所述目标元素的集合以及索 引表, 对所述目标图像块进行编码。  S23. Encode the target image block according to the set of target elements in the target palette of the predictive coding and an index table.
对目标调色板所属信号分量, 建立索引表。 对于目标图像块中的一个 釆样点, 可在调色板模板中找到一个数值上最接近的元素,使得该元素数 值与该釆样点数值的误差最小。 此时, 即可选择调色板模板中该元素数值 作为所述釆样点的重建值, 同时确定该元素(即所述重建值)在调色板模 板中的索引值。目标图像块的信号分量的所有釆样点都可按照类似的方法 确定其重建值并确定该重建值在调色板模板中的索引值。所有釆样点的索 引值构成索引表。将目标调色板所属信号分量的调色板模板和索引表信息 写入码流。  An index table is created for the signal component to which the target palette belongs. For a sample point in the target image block, a numerically closest element can be found in the palette template such that the element value has the smallest error from the sample value. At this point, the value of the element in the palette template can be selected as the reconstructed value of the sample point, and the index value of the element (i.e., the reconstructed value) in the palette template can be determined. All of the sample points of the signal component of the target image block can be determined in a similar manner to their reconstructed values and determine the index value of the reconstructed value in the palette template. The index values of all the sample points constitute an index table. The palette template and index table information of the signal component to which the target palette belongs is written to the code stream.
由此可见,本发明实施例通过例如预测信,包、对目标调色板进行预 'J编 码, 以减少目标调色板的编码开销, 从而进一步提高釆用调色板编码模式 的视频图像的压缩效率。  It can be seen that the embodiment of the present invention further reduces the coding overhead of the target palette by, for example, predicting a message, a packet, and pre-coding the target color palette, thereby further improving the video image of the palette color coding mode. Compression efficiency.
此外, 在确定所述目标调色板的预测信息之前, 还可以预设调色板模 板。 例如, 在编解码过程中, 使用预设的调色板模板。 In addition, before determining the prediction information of the target palette, the palette mode can also be preset. Board. For example, during the codec process, the preset palette template is used.
或者, 在根据所述预测信息对所述目标调色板进行预测编码之后, 还 可以根据所述目标元素的集合中的所述目标元素以及所述调色板模板中 的所述匹配元素对应的计数器数值, 更新所述调色板模板。 例如, 利用所 述目标调色板中的所述至少一个第二类元素,更新所述调色板模板中所述 非匹配元素的集合; 利用所述目标调色板中的所述目标元素, 更新所述调 色板模板中与元素对应的计数器数值。 这样, 使用的调色板模板就是实时 更新的。  Or after the predictive encoding of the target palette according to the prediction information, according to the target element in the set of target elements and the matching element in the palette template. The counter value updates the palette template. For example, updating the set of the non-matching elements in the palette template by using the at least one second class element in the target palette; using the target element in the target palette, Update the counter value corresponding to the element in the palette template. In this way, the palette template used is updated in real time.
因此, 本发明实施例通过例如预测信息对目标调色板进行预测编码, 以减少目标调色板的编码开销,从而进一步提高釆用调色板编码模式的视 频图像的压缩效率。  Therefore, the embodiment of the present invention predictively encodes the target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
图 3至图 5示出了根据本发明实施例的实现目标图像块的解码方法的 解码器。  3 to 5 illustrate a decoder for realizing a decoding method of a target image block according to an embodiment of the present invention.
如图 3所示, 解码器 30包括接收单元 31、 第一确定单元 32、 第二确 定单元 33和解码单元 34。 其中:  As shown in FIG. 3, the decoder 30 includes a receiving unit 31, a first determining unit 32, a second determining unit 33, and a decoding unit 34. among them:
接收单元 31用于从接收到的目标图像块的码流中获取目标调色板的 预测信息, 其中所述目标图像块是釆用调色板编码模式的图像块, 所述目 标调色板是目标元素的集合,所述目标元素的集合中的每个目标元素是基 于所述目标图像块的一个信号分量的釆样点数值确定的具有代表性的数 值, 其中所述目标元素的集合包括至少一个第一类元素和 /或至少一个第 二类元素,所述第一类元素是需要根据调色板模板中的匹配元素确定的目 标元素,所述第二类元素无需根据调色板模板中的匹配元素确定的目标元 素;  The receiving unit 31 is configured to obtain prediction information of a target palette from a code stream of the received target image block, where the target image block is an image block in a palette encoding mode, and the target color palette is a set of target elements, each of the set of target elements being a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least a first class element and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, the second class element not being according to the palette template The target element determined by the matching element;
第一确定单元 32用于根据所述接收单元 31接收的所述预测信息,确 定在所述调色板模板中的匹配元素的集合,其中所述调色板模板由匹配元 素的集合和 /或非匹配元素的集合组成, 所述匹配元素的集合包括至少一 个匹配元素, 所述匹配元素是用于匹配所述第一类元素的元素, 所述第一 类元素的数值与其匹配元素的数值之差的绝对值小于预定值,所述非匹配 元素的集合包括至少一个非匹配元素,所述非匹配元素是无法与所述第一 类元素匹配的元素; The first determining unit 32 is configured to determine, according to the prediction information received by the receiving unit 31, a set of matching elements in the palette template, where the palette template is composed of a matching element and/or a set of non-matching elements, the set of matching elements including at least one matching element, the matching element being an element for matching the first type of element, the value of the first type of element and the value of the matching element The absolute value of the difference is less than a predetermined value, the set of non-matching elements includes at least one non-matching element, and the non-matching element is unable to communicate with the first The element that the class element matches;
第二确定单元 33用于根据所述预测信息与所述第一确定单元 32确定 的所述匹配元素的集合, 确定所述目标元素的集合;  The second determining unit 33 is configured to determine, according to the prediction information, the set of the matching elements determined by the first determining unit 32, the set of the target elements;
解码单元 34用于依据所述第二确定单元 33确定的所述目标元素的集 合, 对所述目标图像块进行解码。  The decoding unit 34 is configured to decode the target image block according to the set of the target elements determined by the second determining unit 33.
当预测信息包括元素预测标识时, 第一确定单元 32用于根据所述元 素预测标识, 确定在所述调色板模板中的匹配元素的集合。  When the prediction information includes an element prediction identifier, the first determining unit 32 is configured to determine a set of matching elements in the palette template according to the element prediction identifier.
具体而言, 所述第一确定单元 32用于当所述元素预测标识为所述调 色板模板的预测标识,根据所述调色板模板的预测标识确定在所述调色板 模板中的匹配元素的集合,其中所述调色板模板的预测标识用于指示所述 调色板模板中的所述匹配元素的集合与所述非匹配元素的集合。  Specifically, the first determining unit 32 is configured to: when the element prediction identifier is a prediction identifier of the palette template, determine, according to the prediction identifier of the palette template, in the palette template. A set of matching elements, wherein the predictive identifier of the palette template is used to indicate a set of the matching elements in the palette template and a set of the non-matching elements.
于是, 当所述匹配元素的集合为非空, 所述预测信息还包括第一预测 位置信息,所述第一预测位置信息用于指示所述匹配元素的集合分别对应 的第一类元素在所述目标元素的集合中的位置;当所述匹配元素的集合中 匹配元素的个数少于所述目标元素的集合中目标元素的个数,第二确定单 元 33用于: 根据所述调色板模板的预测标识、 所述第一预测位置信息和 所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一类 元素的数值及其位置;从所述目标图像块的码流中获取所述目标元素的集 合中的所述至少一个第二类元素的数值。  Then, when the set of the matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the first type of elements corresponding to the set of matching elements respectively a position in the set of target elements; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, the second determining unit 33 is configured to: a prediction identifier of the board template, the first predicted location information, and the set of matching elements, determining a value of the at least one first class element in the set of target elements and a location thereof; from the target image block Obtaining a value of the at least one second type element in the set of the target elements in the code stream.
或者, 当所述匹配元素的集合为非空, 所述预测信息还包括第一预测 位置信息,所述第一预测位置信息用于指示所述匹配元素的集合分别对应 的第一类元素在所述目标元素的集合中的位置;当所述匹配元素的集合中 匹配元素的个数等于所述目标元素的集合中目标元素的个数,第二确定单 元 33用于: 根据所述元素预测标识、 所述第一预测位置信息和所述匹配 元素的集合,确定所述目标元素的集合中的所述至少一个第一类元素的数 值及其位置。  Or, when the set of the matching elements is non-empty, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate that the first type of elements corresponding to the set of matching elements respectively a position in the set of target elements; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: predict the identifier according to the element And determining, by the first predicted location information and the set of matching elements, a value of the at least one first class element in the set of target elements and a location thereof.
或者, 当所述匹配元素的集合为非空, 当所述匹配元素的集合中匹配 元素的个数少于或等于所述目标元素的集合中目标元素的个数,第二确定 单元 33用于: 按照数值大小的升序或降序排列, 根据所述元素预测标识 和所述匹配元素的集合,确定所述目标元素的集合中全部所述目标元素的 数值及其位置。 Or, when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: : sorted in ascending or descending order of numerical values, based on the element prediction identifier And a set of the matching elements, determining a value of all of the target elements in the set of the target elements and a location thereof.
此外, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差 值信息用于指示所述目标调色板中所述至少一个第一类元素中每个第一 类元素与其在所述调色板模板中的匹配元素的差值; 所述第二确定单元 Furthermore, the prediction information further includes first predicted difference information, wherein the first predicted difference information is used to indicate each of the at least one first type element in the target palette and a difference value of matching elements in the palette template; the second determining unit
33 用于: 根据所述第一预测差值信息, 调整所述目标元素的集合中的所 述至少一个第一类元素的数值。 33 is configured to: adjust a value of the at least one first type element in the set of the target elements according to the first predicted difference information.
可选地, 第一确定单元 32用于: 当所述元素预测标识为所述调色板 模板中元素的预测标识,依次根据所述调色板模板中元素的预测标识确定 在所述调色板模板中的匹配元素,所确定的全部的所述匹配元素构成所述 匹配元素的集合,其中所述调色板模板中元素的预测标识用于指示所述调 色板模板中所述元素为匹配元素或非匹配元素。  Optionally, the first determining unit 32 is configured to: when the element prediction identifier is a predicted identifier of an element in the palette template, determine, according to the predicted identifier of the element in the palette template, the color to be determined a matching element in the board template, the determined all of the matching elements forming a set of the matching elements, wherein the predicted identifier of the element in the palette template is used to indicate that the element in the palette template is Matching elements or non-matching elements.
于是, 当所述匹配元素的集合为非空, 所述预测信息还包括第二预测 位置信息,所述第二预测位置信息用于指示所述匹配元素对应的第一类元 素在所述目标元素的集合中的位置;当所述匹配元素的集合中匹配元素的 个数少于所述目标元素的集合中目标元素的个数, 所述第二确定单元 33 用于: 根据所述调色板模板中元素的预测标识、 所述第二预测位置信息和 所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一类 元素的数值和位置;从所述目标图像块的码流中获取所述目标元素的集合 中的所述至少一个第二类元素的数值。  Then, when the set of matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate that the first type element corresponding to the matching element is in the target element a position in the set; when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, the second determining unit 33 is configured to: according to the palette Determining, by the predicted identifier of the element in the template, the second predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; from the target image block Obtaining a value of the at least one second type element in the set of the target elements in the code stream.
或者, 当所述匹配元素的集合为非空, 所述预测信息还包括第二预测 位置信息,所述第二预测位置信息用于指示所述匹配元素对应的第一类元 素在所述目标元素的集合中的位置;当所述匹配元素的集合中匹配元素的 个数等于所述目标元素的集合中目标元素的个数, 所述第二确定单元 33 用于: 根据所述调色板模板中元素的预测标识、 所述第二预测位置信息和 所述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一类 元素的数值和位置。  Or, when the set of matching elements is non-empty, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate that the first type element corresponding to the matching element is in the target element a position in the set; when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: according to the palette template A prediction identifier of the medium element, the second predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements.
或者, 当所述匹配元素的集合为非空, 当所述匹配元素的集合中匹配 元素的个数少于或等于所述目标元素的集合中目标元素的个数,所述第二 确定单元 33用于: 按照数值大小的升序或降序排列, 根据所述元素预测 标识和所述匹配元素的集合,确定所述目标元素的集合中全部目标元素的 数值及其位置。 Or when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, the second The determining unit 33 is configured to: arrange the values of all the target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements according to the ascending or descending order of the numerical values.
此外, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差 值信息用于指示所述目标调色板中所述第一类元素与其在所述调色板模 板中的匹配元素的差值; 所述第二确定单元 33还用于: 根据所述第二预 测差值信息,调整所述目标元素的集合中的所述至少一个第一类元素的数 值。  Furthermore, the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the first type of element in the target palette and its in the palette template The second determining unit 33 is further configured to: adjust a value of the at least one first type element in the set of the target elements according to the second predicted difference information.
可选地, 预测信息还包括第一索引信息, 其中所述第一索引信息用于 指示所述匹配元素的集合中全部匹配元素在所述调色板模板中的对应位 置; 所述第一确定单元 32用于: 当所述元素预测标识为所述目标调色板 的预测标识,且所述目标调色板的预测标识指示所述目标调色板中的所述 至少一个第一类元素,确定所述调色板模板中由所述第一索引信息指示的 对应位置的全部匹配元素构成在所述调色板模板中的匹配元素的集合。  Optionally, the prediction information further includes first index information, where the first index information is used to indicate a corresponding location of all matching elements in the set of matching elements in the palette template; The unit 32 is configured to: when the element prediction identifier is a predicted identifier of the target palette, and the predicted identifier of the target palette indicates the at least one first type element in the target palette, Determining that all of the matching elements of the corresponding position indicated by the first index information in the palette template constitute a set of matching elements in the palette template.
于是,当所述匹配元素的集合中匹配元素的个数少于所述目标元素的 集合中目标元素的个数, 所述第二确定单元 33用于: 根据所述目标调色 板的预测标识、 所述第一索引信息和所述匹配元素的集合, 确定所述目标 元素的集合中的所述至少一个第一类元素的数值和位置;从所述目标图像 块的码流中获取所述目标元素的集合中的所述至少一个第二类元素的数 值。  Then, when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, the second determining unit 33 is configured to:: predictive identifier according to the target color palette And determining, by the first index information and the set of matching elements, a value and a location of the at least one first type element in the set of target elements; acquiring the code from a code stream of the target image block The value of the at least one second type element in the set of target elements.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述第二确定单元 33用于: 根据所述目标调色 板的预测标识、 所述第一索引信息和所述匹配元素的集合, 确定所述目标 元素的集合中的所述至少一个第一类元素的数值和位置。  Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to:: according to the predicted identifier of the target color palette, And determining, by the first index information and the set of matching elements, a value and a location of the at least one first class element in the set of the target elements.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数, 所述第二确定单元 33用于: 按照数值大 小的升序或降序排列,根据所述元素预测标识和所述匹配元素的集合, 确 定所述目标元素的集合中全部目标元素的数值及其位置。  Or, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: sort in ascending or descending order according to the numerical value Determining, according to the element prediction identifier and the set of matching elements, a value of all target elements in the set of the target elements and a location thereof.
此外, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差 值信息用于指示所述目标调色板中所述至少一个第一类元素中每个第一 类元素与其在所述调色板模板中的匹配元素的差值; 所述第二确定单元Furthermore, the prediction information further includes first prediction difference information, wherein the first prediction difference The value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit
33 进一步用于: 根据所述第一预测差值信息, 调整所述目标元素的集合 中的所述至少一个第一类元素的数值。 The method is further configured to: adjust, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
可选地, 所述预测信息还包括第二索引信息, 其中所述第二索引信息 用于指示所述匹配元素在所述调色板模板中的对应位置;所述第一确定单 元 32用于: 当所述元素预测标识为所述目标调色板中元素的预测标识, 且所述目标调色板中目标元素的预测标识用于指示所述目标元素为第一 类元素,依次确定所述调色板模板中由所述第二索引信息指示的对应位置 的匹配元素,所确定的全部所述匹配元素构成在所述调色板模板中的所述 匹配元素的集合。  Optionally, the prediction information further includes second index information, where the second index information is used to indicate a corresponding location of the matching element in the palette template; the first determining unit 32 is configured to: And when the element prediction identifier is a prediction identifier of an element in the target palette, and a prediction identifier of the target element in the target palette is used to indicate that the target element is a first type element, determining the A matching element of a corresponding position indicated by the second index information in the palette template, all of the determined matching elements constitute a set of the matching elements in the palette template.
于是,当所述匹配元素的集合中匹配元素的个数少于所述目标元素的 集合中目标元素的个数, 所述第二确定单元 33用于: 根据所述目标调色 板中元素的预测标识、 所述第二索引信息和所述匹配元素的集合, 确定所 述目标元素的集合中的所述至少一个第一类元素的数值和位置;从所述目 标图像块的码流中获取所述目标元素的集合中的所述至少一个第二类元 素的数值。  Then, when the number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, the second determining unit 33 is configured to: according to the elements in the target palette Determining an identifier, the second index information, and the set of matching elements, determining a value and a location of the at least one first type element in the set of target elements; obtaining from a code stream of the target image block a value of the at least one second type of element in the set of target elements.
或者,当所述匹配元素的集合中匹配元素的个数等于所述目标元素的 集合中目标元素的个数, 所述第二确定单元 33用于: 根据所述目标调色 板中元素的预测标识、 所述第二索引信息和所述匹配元素的集合, 确定所 述目标元素的集合中的所述至少一个第一类元素的数值和位置。  Or, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: predict according to elements in the target color palette And the identifier, the second index information, and the set of matching elements determine a value and a location of the at least one first class element in the set of target elements.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数, 所述第二确定单元 33用于: 按照数值大 小的升序或降序排列,根据所述元素预测标识和所述匹配元素的集合, 确 定所述目标元素的集合中全部目标元素的数值及其位置。  Or, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: sort in ascending or descending order according to the numerical value Determining, according to the element prediction identifier and the set of matching elements, a value of all target elements in the set of the target elements and a location thereof.
此外, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差 值信息用于指示所述目标调色板中所述第一类元素与其在所述调色板模 板中的匹配元素的差值; 所述第二确定单元 33进一步用于: 根据所述第 二预测差值信息,调整确定所述目标元素的集合中的所述至少一个第一类 元素的数值。 Furthermore, the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the first type of element in the target palette and its in the palette template The second determining unit 33 is further configured to: adjust, according to the second predicted difference information, the at least one first category in the set of the target elements The value of the element.
可选地, 所述预测信息还包括第一索引信息, 其中所述第一索引信息 用于指示所述匹配元素的集合中全部匹配元素在所述调色板模板中的对 应位置; 所述第一确定单元 32用于: 当所述元素预测标识为所述调色板 模板中所述匹配元素的集合中所述匹配元素的数目,且所述数目大于或等 于 1 , 确定所述调色板模板中由所述第一索引信息指示的对应位置的全部 匹配元素构成所述调色板模板中的匹配元素的集合 ,其中所述调色板模板 中所述匹配元素的集合中所述匹配元素的数目用于指示为所述目标调色 板能够在所述调色板模板中找到匹配元素的个数。  Optionally, the prediction information further includes first index information, where the first index information is used to indicate a corresponding location of all matching elements in the set of matching elements in the palette template; a determining unit 32 is configured to: when the element prediction identifier is the number of the matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determining the palette All matching elements of the corresponding position indicated by the first index information in the template constitute a set of matching elements in the palette template, wherein the matching elements in the set of matching elements in the palette template The number is used to indicate the number of matching elements that can be found in the palette template for the target palette.
于是, 所述预测信息还包括第一预测位置信息, 所述第一预测位置信 息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元素 的集合中的位置;当所述匹配元素的集合中匹配元素的个数少于所述目标 元素的集合中目标元素的个数, 所述第二确定单元 33用于: 根据所述调 色板模板中所述匹配元素的集合中所述匹配元素的数目、所述第一预测位 置信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一 个第一类元素的数值和位置;从所述目标图像块的码流中获取所述目标元 素的集合中的所述至少一个第二类元素的数值。  Then, the prediction information further includes first predicted location information, where the first predicted location information is used to indicate a location of the first class element corresponding to the set of the matching elements in the set of the target elements; The number of matching elements in the set of matching elements is less than the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: according to the set of the matching elements in the palette template Determining a number of the matching elements, the first predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements; from the target image Obtaining a value of the at least one second type element in the set of the target elements in a code stream of the block.
或者, 所述预测信息还包括第一预测位置信息, 所述第一预测位置信 息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元素 的集合中的位置;当所述匹配元素的集合中匹配元素的个数等于所述目标 元素的集合中目标元素的个数, 所述第二确定单元 33用于: 根据所述调 色板模板中所述匹配元素的集合中所述匹配元素的数目、所述第一预测位 置信息和所述匹配元素的集合,确定所述目标元素的集合中的所述至少一 个第一类元素的数值和位置。  Or the prediction information further includes first predicted location information, where the first predicted location information is used to indicate a location of the first type element corresponding to the set of the matching elements in the set of the target element; The number of matching elements in the set of matching elements is equal to the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: according to the set of the matching elements in the palette template The number of matching elements, the first predicted location information, and the set of matching elements determine a value and a location of the at least one first class element in the set of target elements.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数, 所述第二确定单元 33用于: 按照数值大 小的升序或降序排列,根据所述元素预测标识和所述匹配元素的集合, 确 定所述目标元素的集合中全部目标元素的数值及其位置。  Or, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: sort in ascending or descending order according to the numerical value Determining, according to the element prediction identifier and the set of matching elements, a value of all target elements in the set of the target elements and a location thereof.
此外, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差 值信息用于指示所述目标调色板中所述至少一个第一类元素中每个第一 类元素与其在所述调色板模板中的匹配元素的差值; 所述第二确定单元Furthermore, the prediction information further includes first prediction difference information, wherein the first prediction difference The value information is used to indicate a difference between each of the at least one first type of elements in the target palette and a matching element thereof in the palette template; the second determining unit
33 还用于: 根据所述第一预测差值信息, 调整所述目标元素的集合中的 所述至少一个第一类元素的数值。 The method is further configured to: adjust, according to the first predicted difference information, a value of the at least one first type element in the set of the target elements.
可选地, 所述预测信息还包括第二索引信息, 其中所述第二索引信息 用于指示所述匹配元素在所述调色板模板中的对应位置;所述第一确定单 元 32用于: 当所述元素预测标识为所述调色板模板中所述匹配元素的集 合中所述匹配元素的数目, 且所述数目大于或等于 1 , 依次确定所述调色 板模板中由所述第二索引信息指示的对应位置的匹配元素,所确定的全部 所述匹配元素构成所述调色板模板中的匹配元素的集合,其中所述调色板 模板中所述匹配元素的集合中所述匹配元素的数目用于指示为所述目标 调色板能够在所述调色板模板中找到匹配元素的个数。  Optionally, the prediction information further includes second index information, where the second index information is used to indicate a corresponding location of the matching element in the palette template; the first determining unit 32 is configured to: : when the element prediction identifier is the number of the matching elements in the set of the matching elements in the palette template, and the number is greater than or equal to 1, sequentially determining that the palette template is a matching element of the corresponding location indicated by the second index information, all of the determined matching elements forming a set of matching elements in the palette template, wherein the set of matching elements in the palette template is The number of matching elements is used to indicate the number of matching elements that can be found in the palette template for the target palette.
于是, 所述预测信息还包括第二预测位置信息, 所述第二预测位置信 息用于指示所述匹配元素对应的第一类元素在所述目标元素的集合中的 位置;当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合 中目标元素的个数, 所述第二确定单元 33用于: 根据所述调色板模板中 所述匹配元素的集合中所述匹配元素的数目、所述第二预测位置信息和所 述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一类元 素的数值和位置;从所述目标图像块的码流中获取所述目标元素的集合中 的所述至少一个第二类元素的数值。  Then, the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of target elements; when the matching element The number of matching elements in the set is less than the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: according to the set of the matching elements in the palette template Determining, by the number of matching elements, the second predicted location information, and the set of matching elements, a value and a location of the at least one first class element in the set of target elements; a code from the target image block The value of the at least one second type element in the set of the target elements is obtained in the stream.
或者, 所述预测信息还包括第二预测位置信息, 所述第二预测位置信 息用于指示所述匹配元素对应的第一类元素在所述目标元素的集合中的 位置;当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合 中目标元素的个数, 所述第二确定单元 33用于: 根据所述调色板模板中 所述匹配元素的集合中所述匹配元素的数目、所述第二预测位置信息和所 述匹配元素的集合,确定所述目标元素的集合中的所述至少一个第一类元 素的数值和位置。  Or the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of target elements; when the matching element The number of matching elements in the set is equal to the number of target elements in the set of the target elements, and the second determining unit 33 is configured to: match the matches in the set of matching elements in the palette template A number of elements, the second predicted location information, and the set of matching elements, determining a value and a location of the at least one first class element in the set of target elements.
或者,当所述匹配元素的集合中匹配元素的个数少于或等于所述目标 元素的集合中目标元素的个数, 所述第二确定单元 33用于: 按照数值大 小的升序或降序排列,根据所述元素预测标识和所述匹配元素的集合, 确 定所述目标元素的集合中全部目标元素的数值及其位置。 Or, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of the target elements, the second determining unit 33 is configured to: A small ascending or descending order, determining a value of all target elements in the set of the target elements and their positions according to the element prediction identifier and the set of matching elements.
此外, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差 值信息用于指示所述目标调色板中所述第一类元素与其在所述调色板模 板中的匹配元素的差值; 所述第二确定单元 33还用于: 根据所述第二预 测差值信息,调整所述目标元素的集合中的所述至少一个第一类元素的数 值。  Furthermore, the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the first type of element in the target palette and its in the palette template The second determining unit 33 is further configured to: adjust a value of the at least one first type element in the set of the target elements according to the second predicted difference information.
进一步的, 所述预测信息还包括预测指示信息, 所述预测指示信息用 于指示所述目标调色板中是否存在一个所述第一类元素能够根据所述预 测信息与所述匹配元素的集合而确定。  Further, the prediction information further includes prediction indication information, where the prediction indication information is used to indicate whether there is a set of the first type element in the target palette according to the prediction information and the matching element. And ok.
图 4所示的解码器 40还包括第一预设单元 35 , 用于在所述根据所述 预测信息, 确定在所述调色板模板中的匹配元素的集合之前, 预设所述调 色板模板。  The decoder 40 shown in FIG. 4 further includes a first preset unit 35, configured to preset the color before determining the set of matching elements in the palette template according to the prediction information. Board template.
图 5所示的解码器 50还包括: 第一更新单元 36 , 用于在所述根据所 述预测信息与所述匹配元素的集合, 确定所述目标元素的集合之后,根据 所述目标元素的集合中的所述目标元素以及所述调色板模板中的所述匹 配元素对应的计数器数值, 更新所述调色板模板。  The decoder 50 shown in FIG. 5 further includes: a first updating unit 36, configured to determine, according to the prediction information and the set of matching elements, the set of the target elements, according to the target element Updating the palette template by the target element in the collection and a counter value corresponding to the matching element in the palette template.
其中, 第一更新单元 36具体用于: 利用所述目标调色板中的所述至 少一个第二类元素, 更新所述调色板模板中所述非匹配元素的集合; 利用 所述目标调色板中的所述目标元素 ,更新所述调色板模板中与元素对应的 计数器数值。  The first updating unit 36 is specifically configured to: update, by using the at least one second type element in the target color palette, a set of the non-matching elements in the palette template; The target element in the swatch updates a counter value corresponding to the element in the palette template.
本发明实施例通过例如预测信息对目标调色板进行预测编码,以减少 目标调色板的编码开销,从而进一步提高釆用调色板编码模式的视频图像 的压缩效率。  Embodiments of the present invention predictively encode a target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
图 6至图 8示出了实现本发明实施例的目标图像块的编码方法的编码 哭口 o  6 to 8 illustrate coding of a coding method of a target image block implementing an embodiment of the present invention.
如图 6所示, 编码器 60 包括构造单元 61、 预处理单元 62和编码单 元 63。 其中:  As shown in Fig. 6, the encoder 60 includes a construction unit 61, a pre-processing unit 62, and an encoding unit 63. among them:
构造单元 61用于构造目标调色板, 其中所述目标调色板是目标元素 的集合,所述目标元素的集合中的每个目标元素是基于所述目标图像块的 一个信号分量的釆样点数值确定的具有代表性的数值,其中所述目标元素 的集合包括至少一个第一类元素和 /或至少一个第二类元素, 所述第一类 元素是需要根据调色板模板中的匹配元素确定的目标元素,所述第二类元 素无需根据调色板模板中的匹配元素确定的目标元素; The construction unit 61 is configured to construct a target palette, wherein the target palette is a target element a set of the target elements, wherein each of the target elements is a representative value determined based on a sample point value of a signal component of the target image block, wherein the set of target elements includes at least one a class of elements and/or at least one second class element, the first class element being a target element that needs to be determined according to a matching element in the palette template, the second class element not being based on a match in the palette template The target element determined by the element;
预处理单元 62用于确定所述构造单元 61构造的所述目标调色板的预 测信息, 并根据所述预测信息对所述目标调色板进行预测编码, 以便确定 所述目标调色板中的所述至少一个第一类元素在所述调色板模板中的匹 配元素的集合, 其中所述调色板模板由匹配元素的集合和 /或非匹配元素 的集合组成, 所述匹配元素的集合包括至少一个匹配元素, 所述匹配元素 是用于匹配所述第一类元素的元素,所述第一类元素的数值与其匹配元素 的数值之差的绝对值小于预定值,所述非匹配元素的集合包括至少一个非 匹配元素, 所述非匹配元素是无法与所述第一类元素匹配的元素;  The pre-processing unit 62 is configured to determine prediction information of the target palette constructed by the construction unit 61, and predictively encode the target palette according to the prediction information, so as to determine the target palette. a set of matching elements of the at least one first class element in the palette template, wherein the palette template is composed of a set of matching elements and/or a set of non-matching elements, the matching elements The set includes at least one matching element, the matching element is an element for matching the first type of element, and an absolute value of a difference between a value of the first type element and a value of the matching element is less than a predetermined value, the non-matching The set of elements includes at least one non-matching element, the non-matching element being an element that cannot match the first type of element;
编码单元 63用于根据所述预处理单元 62预测编码的目标调色板中所 述目标元素的集合以及索引表, 对所述目标图像块进行编码。  The encoding unit 63 is configured to encode the target image block according to the set of the target elements in the target palette that is predicted by the pre-processing unit 62 and the index table.
其中, 所述预测信息包括元素预测标识, 所述元素预测标识为所述调 色板模板的预测标识,其中所述调色板模板的预测标识用于指示所述调色 板模板中的所述匹配元素的集合与所述非匹配元素的集合;或者所述元素 预测标识为所述调色板模板中元素的预测标识,其中所述调色板模板中元 素的预测标识用于指示所述调色板模板中所述元素为匹配元素或非匹配 元素; 或者所述元素预测标识为所述目标调色板的预测标识, 其中所述目 标调色板的预测标识用于指示所述目标元素的集合中的第一类元素和 /或 第二类元素; 或者所述元素预测标识为所述目标调色板中元素的预测标 识,其中所述目标调色板中目标元素的预测标识用于指示所述目标元素为 第一类元素或第二类元素;或者所述元素预测标识为所述调色板模板中所 述匹配元素的集合中所述匹配元素的数目,用于指示为所述目标调色板能 够在所述调色板模板中找到匹配元素的个数。  The prediction information includes an element prediction identifier, where the element prediction identifier is a prediction identifier of the palette template, where the prediction identifier of the palette template is used to indicate the a set of matching elements and a set of the non-matching elements; or the element prediction identifier is a predicted identifier of an element in the palette template, wherein a predicted identifier of an element in the palette template is used to indicate the tone The element in the swatch template is a matching element or a non-matching element; or the element predictive identifier is a predicted identifier of the target palette, wherein the predicted identifier of the target palette is used to indicate the target element a first type of element and/or a second type of element in the set; or the element predictive identifier is a predicted identifier of the element in the target palette, wherein the predicted identifier of the target element in the target palette is used to indicate The target element is a first type element or a second type element; or the element prediction identifier is the one of the set of the matching elements in the palette template Number of elements, for indicating the color palette of the target number of matching elements can be found in the palette of templates.
此外, 预测信息还可以包括第一预测位置信息, 所述第一预测位置信 息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元素 的集合中的位置; 或者所述预测信息还包括第二预测位置信息, 所述第二 预测位置信息用于指示所述匹配元素对应的第一类元素在所述目标元素 的集合中的位置。 In addition, the prediction information may further include first predicted location information, where the first predicted location information is used to indicate that the first class element corresponding to the set of matching elements respectively is in the target element Or the prediction information further includes second predicted location information, where the second predicted location information is used to indicate a location of the first type element corresponding to the matching element in the set of the target elements.
此外, 预测信息还可以包括第一索引信息, 其中所述第一索引信息用 于指示所述匹配元素的集合中全部匹配元素在所述调色板模板中的对应 位置; 或者所述预测信息还包括第二索引信息, 其中所述第二索引信息用 于指示所述匹配元素在所述调色板模板中的对应位置。  In addition, the prediction information may further include first index information, where the first index information is used to indicate a corresponding position of all matching elements in the set of matching elements in the palette template; or the prediction information is further The second index information is included, wherein the second index information is used to indicate a corresponding position of the matching element in the palette template.
此外, 预测信息还可以包括第一预测差值信息, 其中所述第一预测差 值信息用于指示所述目标调色板中所述至少一个第一类元素中每个第一 类元素与其在所述调色板模板中的匹配元素的差值;或者所述预测信息还 包括第二预测差值信息,其中所述第二预测差值信息用于指示所述目标调 色板中所述第一类元素与其在所述调色板模板中的匹配元素的差值。  Furthermore, the prediction information may further include first predicted difference information, wherein the first predicted difference information is used to indicate that each of the at least one first type of elements in the target palette is a difference value of the matching elements in the palette template; or the prediction information further includes second predicted difference information, wherein the second predicted difference information is used to indicate the number in the target palette The difference between a class of elements and their matching elements in the palette template.
此外, 预测信息还可以包括预测指示信息, 所述预测指示信息用于指 示所述目标调色板中是否存在一个所述第一类元素能够根据所述预测信 息与所述匹配元素的集合而确定。  In addition, the prediction information may further include prediction indication information, where the prediction indication information is used to indicate whether one of the first class elements in the target palette is determined according to the prediction information and the set of matching elements. .
图 7所示的编码器 70还包括第二预设单元 64 , 用于在所述确定所述 目标调色板的预测信息之前, 预设所述调色板模板。  The encoder 70 shown in Fig. 7 further includes a second preset unit 64 for presetting the palette template before the prediction information of the target palette is determined.
图 8所示的编码器 80还包括第二更新单元 65 , 用于在所述根据所述 预测信息对所述目标调色板进行预测编码之后,根据所述目标元素的集合 中的所述目标元素以及所述调色板模板中的所述匹配元素对应的计数器 数值, 更新所述调色板模板。  The encoder 80 shown in FIG. 8 further includes a second updating unit 65, configured to: according to the target in the set of target elements after the predictive encoding of the target palette according to the prediction information The palette template is updated by an element and a counter value corresponding to the matching element in the palette template.
例如, 第二更新单元 65具体用于: 利用所述目标调色板中的所述至 少一个第二类元素, 更新所述调色板模板中所述非匹配元素的集合; 利用 所述目标调色板中的所述目标元素 ,更新所述调色板模板中与元素对应的 计数器数值。  For example, the second updating unit 65 is specifically configured to: update, by using the at least one second class element in the target color palette, a set of the non-matching elements in the palette template; The target element in the swatch updates a counter value corresponding to the element in the palette template.
本发明实施例通过例如预测信息对目标调色板进行预测编码,以减少 目标调色板的编码开销,从而进一步提高釆用调色板编码模式的视频图像 的压缩效率。  Embodiments of the present invention predictively encode a target palette by, for example, predicting information to reduce the encoding overhead of the target palette, thereby further improving the compression efficiency of the video image in the palette encoding mode.
应理解, 本发明的每个权利要求所叙述的方案也应看做是一个实施 例, 并且是权利要求中的特征是可以结合的, 如本发明中的判断步骤后的 执行的不同分支的步骤可以作为不同的实施例。 It should be understood that the solution described in each of the claims of the present invention should also be regarded as an implementation. For example, and the features in the claims may be combined, the steps of the different branches of the execution after the determining step in the present invention may be used as different embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的 各示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件 的结合来实现。 这些功能究竟以硬件还是软件方式来执行,取决于技术方 案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使 用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范 围。  Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technology solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述 描述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的 对应过程, 在此不再赘述。  A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置 和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅 是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实 现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成 到另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论 的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单 元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。  In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的, 作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地 方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的 部分或者全部单元来实现本实施例方案的目的。  The units described as separate components may or may not be physically separated, and the components displayed as the units may or may not be physical units, that is, may be located at one place, or may be distributed to a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在 一个单元中。  In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或 使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本 发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方 案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个 存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分 步骤。 而前述的存储介质包括: U 盘、 移动硬盘、 只读存储器 (ROM, Read-Only Memory )、 随机存取存储器 ( RAM, Random Access Memory )、 磁碟或者光盘等各种可以存储程序代码的介质。 The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, or the part contributing to the prior art or the part of the technical solution, may be embodied in the form of a software product stored in a The storage medium includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应所述以权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims

权 利 要 求 书 claims
1、 一种目标图像块的解码方法, 其特征在于, 包括: 1. A method for decoding target image blocks, characterized by including:
从接收到的目标图像块的码流中获取目标调色板的预测信息, 其中所 述目标图像块是釆用调色板编码模式的图像块, 所述目标调色板是目标元 素的集合, 所述目标元素的集合中的每个目标元素是基于所述目标图像块 的一个信号分量的釆样点数值确定的具有代表性的数值, 其中所述目标元 素的集合包括至少一个第一类元素和 /或至少一个第二类元素,所述第一类 元素是需要根据调色板模板中的匹配元素确定的目标元素, 所述第二类元 素无需根据调色板模板中的匹配元素确定的目标元素; Obtain the prediction information of the target palette from the code stream of the received target image block, where the target image block is an image block using the palette encoding mode, and the target palette is a set of target elements, Each target element in the set of target elements is a representative value determined based on a sampling point value of a signal component of the target image block, wherein the set of target elements includes at least one first type element and/or at least one second type element. The first type element is a target element that needs to be determined based on the matching elements in the palette template. The second type element does not need to be determined based on the matching elements in the palette template. target element;
根据所述预测信息, 确定在所述调色板模板中的匹配元素的集合, 其 中所述调色板模板由匹配元素的集合和 /或非匹配元素的集合组成,所述匹 配元素的集合包括至少一个匹配元素, 所述匹配元素是用于匹配所述第一 类元素的元素, 所述第一类元素的数值与其匹配元素的数值之差的绝对值 小于预定值, 所述非匹配元素的集合包括至少一个非匹配元素, 所述非匹 配元素是无法与所述第一类元素匹配的元素; According to the prediction information, a set of matching elements in the palette template is determined, wherein the palette template consists of a set of matching elements and/or a set of non-matching elements, and the set of matching elements includes At least one matching element, the matching element is an element used to match the first type of element, the absolute value of the difference between the value of the first type element and the value of the matching element is less than a predetermined value, and the non-matching element The set includes at least one non-matching element, where the non-matching element is an element that cannot match the first type of element;
根据所述预测信息与所述匹配元素的集合,确定所述目标元素的集合; 依据所述目标元素的集合, 对所述目标图像块进行解码。 Determine the set of target elements based on the prediction information and the set of matching elements; decode the target image block based on the set of target elements.
2、 根据权利要求 1所述的解码方法, 其特征在于, 所述预测信息包括 元素预测标识; 2. The decoding method according to claim 1, characterized in that the prediction information includes an element prediction identifier;
所述根据所述预测信息,确定在所述调色板模板中的匹配元素的集合, 包括: Determining a set of matching elements in the palette template according to the prediction information includes:
根据所述元素预测标识,确定在所述调色板模板中的匹配元素的集合。 Based on the element prediction identification, a set of matching elements in the palette template is determined.
3、 根据权利要求 2所述的解码方法, 其特征在于, 所述根据所述元素 预测标识, 确定在所述调色板模板中的匹配元素的集合, 包括: 3. The decoding method according to claim 2, characterized in that: determining a set of matching elements in the palette template according to the element prediction identifier includes:
当所述元素预测标识为所述调色板模板的预测标识, 根据所述调色板 模板的预 'j标识确定在所述调色板模板中的匹配元素的集合, 其中所述调 色板模板的预测标识用于指示所述调色板模板中的所述匹配元素的集合与 所述非匹配元素的集合。 When the element prediction identification is the prediction identification of the palette template, a set of matching elements in the palette template is determined according to the pre-identification of the palette template, wherein the palette The prediction identification of the template is used to indicate the set of matching elements and the set of non-matching elements in the palette template.
4、 根据权利要求 3所述的解码方法, 其特征在于, 当所述匹配元素的 集合为非空, 所述预测信息还包括第一预测位置信息, 所述第一预测位置 信息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元素 的集合中的位置; 4. The decoding method according to claim 3, wherein when the set of matching elements is non-empty, the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the The position of the first type element corresponding to the set of matching elements in the set of target elements;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements. , include:
根据所述调色板模板的预测标识、 所述第一预测位置信息和所述匹配 元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数 值及其位置; Determine the number of the at least one first type element in the set of target elements according to the prediction identification of the palette template, the first prediction position information and the set of matching elements. value and its position;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
5、 根据权利要求 3所述的解码方法, 其特征在于, 当所述匹配元素的 集合为非空, 所述预测信息还包括第一预测位置信息, 所述第一预测位置 信息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元素 的集合中的位置; 5. The decoding method according to claim 3, wherein when the set of matching elements is non-empty, the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the The position of the first type element corresponding to the set of matching elements in the set of target elements;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements, include:
根据所述元素预测标识、 所述第一预测位置信息和所述匹配元素的集 合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值及其位 置。 According to the element prediction identifier, the first predicted position information and the set of matching elements, the value and position of the at least one first type element in the set of target elements are determined.
6、 根据权利要求 3所述的解码方法, 其特征在于, 当所述匹配元素的 集合为非空, 当所述匹配元素的集合中匹配元素的个数少于或等于所述目 标元素的集合中目标元素的个数, 所述根据所述预测信息与所述匹配元素 的集合, 确定所述目标元素的集合, 包括: 6. The decoding method according to claim 3, characterized in that when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the set of target elements The number of target elements in , and determining the set of target elements based on the prediction information and the set of matching elements includes:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部所述目标元素的数值及其位 置。 Arranged in ascending or descending order of numerical value, and based on the element prediction identifier and the set of matching elements, the values and positions of all the target elements in the set of target elements are determined.
7、 根据权利要求 4至 6中任一项所述的解码方法, 其特征在于, 所述 预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于指示 所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在所述 调色板模板中的匹配元素的差值; 7. The decoding method according to any one of claims 4 to 6, characterized in that the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target The difference between each first-type element in the at least one first-type element in the palette and its matching element in the palette template;
所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的 集合, 包括: Determining the set of target elements based on the prediction information and the set of matching elements includes:
根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the first prediction difference information.
8、 根据权利要求 2所述的解码方法, 其特征在于, 所述根据所述元素 预测标识, 确定在所述调色板模板中的匹配元素的集合, 包括: 8. The decoding method according to claim 2, characterized in that: determining a set of matching elements in the palette template according to the element prediction identifier includes:
当所述元素预测标识为所述调色板模板中元素的预测标识, 依次根据 所述调色板模板中元素的预测标识确定在所述调色板模板中的匹配元素, 所确定的全部的所述匹配元素构成所述匹配元素的集合, 其中所述调色板 模板中元素的预测标识用于指示所述调色板模板中所述元素为匹配元素或 非匹配元素。 When the predicted identification of the element is the predicted identification of the element in the palette template, matching elements in the palette template are determined sequentially according to the predicted identification of the element in the palette template, and all the determined elements are The matching elements constitute a set of the matching elements, wherein the predicted identification of the elements in the palette template is used to indicate whether the element in the palette template is a matching element or a non-matching element.
9、 根据权利要求 8所述的解码方法, 其特征在于, 当所述匹配元素的 集合为非空, 所述预测信息还包括第二预测位置信息, 所述第二预测位置 信息用于指示所述匹配元素对应的第一类元素在所述目标元素的集合中的 位置; 当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: 9. The decoding method according to claim 8, wherein when the set of matching elements is non-empty, the prediction information further includes second prediction position information, and the second prediction position information is used to indicate the The position of the first type element corresponding to the matching element in the set of target elements; When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements. , include:
根据所述调色板模板中元素的预测标识、 所述第二预测位置信,包、和所 述匹配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元 素的数值和位置; Determine the value of the at least one first type element in the set of target elements according to the predicted identification of the element in the palette template, the second predicted position information packet, and the set of matching elements. and location;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
1 0、 根据权利要求 8所述的解码方法, 其特征在于, 当所述匹配元素 的集合为非空, 所述预测信息还包括第二预测位置信息, 所述第二预测位 置信息用于指示所述匹配元素对应的第一类元素在所述目标元素的集合中 的位置; 10. The decoding method according to claim 8, characterized in that when the set of matching elements is non-empty, the prediction information also includes second prediction position information, and the second prediction position information is used to indicate The position of the first type element corresponding to the matching element in the set of target elements;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements, include:
根据所述调色板模板中元素的预测标识、 所述第二预测位置信,包、和所 述匹配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元 素的数值和位置。 Determine the value of the at least one first type element in the set of target elements according to the predicted identification of the element in the palette template, the second predicted position information packet, and the set of matching elements. and location.
1 1、 根据权利要求 8所述的解码方法, 其特征在于, 当所述匹配元素 的集合为非空, 当所述匹配元素的集合中匹配元素的个数少于或等于所述 目标元素的集合中目标元素的个数, 所述根据所述预测信息与所述匹配元 素的集合, 确定所述目标元素的集合, 包括: 1 1. The decoding method according to claim 8, characterized in that when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the number of the target elements The number of target elements in the set, and determining the set of target elements based on the prediction information and the set of matching elements includes:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
1 2、 根据权利要求 9至 1 1中任一项所述的解码方法, 其特征在于, 所 述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息用于指 示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹配元素 的差值; 12. The decoding method according to any one of claims 9 to 11, characterized in that the prediction information further includes second prediction difference information, wherein the second prediction difference information is used to indicate the The difference between the first type element in the target palette and its matching element in the palette template;
所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的 集合, 包括: Determining the set of target elements based on the prediction information and the set of matching elements includes:
根据所述第二预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the second prediction difference information.
1 3、 根据权利要求 2所述的解码方法, 其特征在于, 所述预测信息还 包括第一索引信息, 其中所述第一索引信息用于指示所述匹配元素的集合 中全部匹配元素在所述调色板模板中的对应位置; 13. The decoding method according to claim 2, wherein the prediction information further includes first index information, wherein the first index information is used to indicate where all matching elements in the set of matching elements are located. The corresponding position in the palette template;
所述根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的 集合, 包括: Determining a set of matching elements in the palette template according to the element prediction identification includes:
当所述元素预测标识为所述目标调色板的预测标识, 且所述目标调色 板的预测标识指示所述目标调色板中的所述至少一个第一类元素, 确定所 述调色板模板中由所述第一索引信息指示的对应位置的全部匹配元素构成 在所述调色板模板中的匹配元素的集合。 When the element prediction identification is the prediction identification of the target palette, and the prediction identification of the target palette indicates the at least one first type element in the target palette, determine the All matching elements at corresponding positions indicated by the first index information in the palette template constitute a set of matching elements in the palette template.
14、 根据权利要求 1 3所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数少于所述目标元素的集合中目标元素的个数, 所 述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 14. The decoding method according to claim 13, wherein when the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the decoding method according to the The set of prediction information and the matching elements determines the set of target elements, including:
根据所述目标调色板的预测标识、 所述第一索引信息和所述匹配元素 的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和 位置; Determine the value and position of the at least one first type element in the set of target elements according to the predicted identification of the target palette, the first index information and the set of matching elements;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
1 5、 根据权利要求 1 3所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数等于所述目标元素的集合中目标元素的个数, 所 述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 15. The decoding method according to claim 13, wherein when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the decoding method according to the The set of prediction information and the matching elements determines the set of target elements, including:
根据所述目标调色板的预测标识、 所述第一索引信息和所述匹配元素 的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和 位置。 Determine the value and position of the at least one first type element in the set of target elements according to the predicted identification of the target palette, the first index information and the set of matching elements.
1 6、 根据权利要求 1 3所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的 集合, 包括: 16. The decoding method according to claim 13, characterized in that when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the Determining the set of target elements based on the prediction information and the set of matching elements includes:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
1 7、 根据权利要求 14至 1 6中任一项所述的解码方法, 其特征在于, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于 指示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在 所述调色板模板中的匹配元素的差值; 17. The decoding method according to any one of claims 14 to 16, characterized in that the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the The difference between each first-type element in the at least one first-type element in the target palette and its matching element in the palette template;
所述根据所述目标调色板的预测标识、 所述第一索引信息和所述匹配 元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素, 包 括: Determining the at least one first type element in the set of target elements based on the predicted identification of the target palette, the first index information and the set of matching elements includes:
根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the first prediction difference information.
1 8、 根据权利要求 2所述的解码方法, 其特征在于, 所述预测信息还 包括第二索引信息, 其中所述第二索引信息用于指示所述匹配元素在所述 调色板模板中的对应位置; 18. The decoding method according to claim 2, wherein the prediction information further includes second index information, wherein the second index information is used to indicate that the matching element is in the palette template corresponding position;
所述根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的 集合, 包括: Determining a set of matching elements in the palette template according to the element prediction identification includes:
当所述元素预测标识为所述目标调色板中元素的预测标识, 且所述目 标调色板中目标元素的预测标识用于指示所述目标元素为第一类元素, 依 次确定所述调色板模板中由所述第二索引信息指示的对应位置的匹配元 素, 所确定的全部所述匹配元素构成在所述调色板模板中的所述匹配元素 的集合。 When the element prediction identification is the prediction identification of the element in the target palette, and the target The predicted identification of the target element in the target palette is used to indicate that the target element is a first type element, and the matching elements at the corresponding positions indicated by the second index information in the palette template are determined in turn, and the determined All of the matching elements constitute the set of the matching elements in the palette template.
1 9、 根据权利要求 1 8所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数少于所述目标元素的集合中目标元素的个数, 所 述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 19. The decoding method according to claim 18, characterized in that when the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the The prediction information and the set of matching elements are determined to determine the set of target elements, including:
根据所述目标调色板中元素的预测标识、 所述第二索引信,包、和所述匹 配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的 数值和位置; Determine the numerical sum of the at least one first type element in the set of target elements based on the predicted identification of the element in the target palette, the second index information packet, and the set of matching elements. Location;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
20、 根据权利要求 1 8所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数等于所述目标元素的集合中目标元素的个数, 所 述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合, 包括: 20. The decoding method according to claim 18, characterized in that, when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the prediction based on The set of information and the matching elements determines the set of target elements, including:
根据所述目标调色板中元素的预测标识、 所述第二索引信,包、和所述匹 配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的 数值和位置。 Determine the numerical sum of the at least one first type element in the set of target elements based on the predicted identification of the element in the target palette, the second index information packet, and the set of matching elements. Location.
21、 根据权利要求 1 8所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的 集合, 包括: 21. The decoding method according to claim 18, characterized in that, when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the method according to The prediction information and the set of matching elements determine the set of target elements, including:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
22、 根据权利要求 1 9至 2 1 中任一项所述的解码方法, 其特征在于, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息用于 指示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹配元 素的差值; 22. The decoding method according to any one of claims 19 to 21, wherein the prediction information further includes second prediction difference information, wherein the second prediction difference information is used to indicate the The difference between the first type element in the target palette and its matching element in the palette template;
所述根据所述目标调色板中元素的预测标识、 所述第二索引信,包、和所 述匹配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元 素, 包括: Determining the at least one first type element in the set of target elements based on the predicted identification of the element in the target palette, the second index information packet, and the set of matching elements, include:
根据所述第二预测差值信息, 调整确定所述目标元素的集合中的所述 至少一个第一类元素的数值。 According to the second prediction difference information, adjust the value of the at least one first type element in the set of target elements.
2 3、 根据权利要求 2所述的解码方法, 其特征在于, 所述预测信息还 包括第一索引信息, 其中所述第一索引信息用于指示所述匹配元素的集合 中全部匹配元素在所述调色板模板中的对应位置; 23. The decoding method according to claim 2, wherein the prediction information further includes first index information, wherein the first index information is used to indicate where all matching elements in the set of matching elements are located. The corresponding position in the palette template;
所述根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的 集合, 包括: Determine the matching element in the palette template according to the element prediction identifier. Collection, including:
当所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目, 且所述数目大于或等于 1 , 确定所述调色板模板中由所 述第一索引信息指示的对应位置的全部匹配元素构成所述调色板模板中的 匹配元素的集合, 其中所述调色板模板中所述匹配元素的集合中所述匹配 元素的数目用于指示为所述目标调色板能够在所述调色板模板中找到匹配 元素的个数。 When the element prediction identifier is the number of matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, it is determined that the first element in the palette template is All matching elements at corresponding positions indicated by the index information constitute a set of matching elements in the palette template, where the number of matching elements in the set of matching elements in the palette template is used to indicate the The number of matching elements that can be found in the palette template in the target palette.
24、 根据权利要求 23所述的解码方法, 其特征在于, 所述预测信息还 包括第一预测位置信息, 所述第一预测位置信息用于指示所述匹配元素的 集合分别对应的第一类元素在所述目标元素的集合中的位置; 24. The decoding method according to claim 23, wherein the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the first category corresponding to the set of matching elements. The position of the element in the set of said target elements;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements. , include:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置; Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the first predicted position information and the set of matching elements. The value and position of the first type element;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
25、 根据权利要求 23所述的解码方法, 其特征在于, 所述预测信息还 包括第一预测位置信息, 所述第一预测位置信息用于指示所述匹配元素的 集合分别对应的第一类元素在所述目标元素的集合中的位置; 25. The decoding method according to claim 23, wherein the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the first category corresponding to the set of matching elements. The position of the element in the set of said target elements;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements, include:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置。 Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the first predicted position information and the set of matching elements. The value and position of the first type element.
26、 根据权利要求 23所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的 集合, 包括: 26. The decoding method according to claim 23, wherein when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the The prediction information and the set of matching elements are determined to determine the set of target elements, including:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
27、 根据权利要求 24至 26中任一项所述的解码方法, 其特征在于, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于 指示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在 所述调色板模板中的匹配元素的差值; 27. The decoding method according to any one of claims 24 to 26, wherein the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target The difference between each first-type element in the at least one first-type element in the palette and its matching element in the palette template;
所述根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数 目、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目标元素的 集合中的所述至少一个第一类元素, 包括: Determining the target element based on the number of matching elements in the set of matching elements in the palette template, the first predicted position information and the set of matching elements. The at least one first-type element in the set includes:
根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the first prediction difference information.
28、 根据权利要求 2所述的解码方法, 其特征在于, 所述预测信息还 包括第二索引信息, 其中所述第二索引信息用于指示所述匹配元素在所述 调色板模板中的对应位置; 28. The decoding method according to claim 2, wherein the prediction information further includes second index information, wherein the second index information is used to indicate the position of the matching element in the palette template. Corresponding position;
所述根据所述元素预测标识, 确定在所述调色板模板中的匹配元素的 集合, 包括: Determining a set of matching elements in the palette template according to the element prediction identification includes:
当所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目, 且所述数目大于或等于 1 , 依次确定所述调色板模板中 由所述第二索引信息指示的对应位置的匹配元素, 所确定的全部所述匹配 元素构成所述调色板模板中的匹配元素的集合, 其中所述调色板模板中所 述匹配元素的集合中所述匹配元素的数目用于指示为所述目标调色板能够 在所述调色板模板中找到匹配元素的个数。 When the element prediction identifier is the number of matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determine the number of matching elements in the palette template in turn. The matching elements at the corresponding positions indicated by the two index information, all the determined matching elements constitute a set of matching elements in the palette template, wherein the set of matching elements in the palette template is described in The number of matching elements is used to indicate the number of matching elements that can be found in the palette template for the target palette.
29、 根据权利要求 28所述的解码方法, 其特征在于, 所述预测信息还 包括第二预测位置信息, 所述第二预测位置信息用于指示所述匹配元素对 应的第一类元素在所述目标元素的集合中的位置; 29. The decoding method according to claim 28, wherein the prediction information further includes second prediction position information, and the second prediction position information is used to indicate where the first type element corresponding to the matching element is located. Describes the position of the target element in the collection;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements. , include:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置; Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the second predicted position information and the set of matching elements. The value and position of the first type element;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
30、 根据权利要求 28所述的解码方法, 其特征在于, 所述预测信息还 包括第二预测位置信息, 所述第二预测位置信息用于指示所述匹配元素对 应的第一类元素在所述目标元素的集合中的位置; 30. The decoding method according to claim 28, wherein the prediction information further includes second prediction position information, and the second prediction position information is used to indicate where the first type element corresponding to the matching element is located. Describes the position of the target element in the collection;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述根据所述预测信息与所述匹配元素的集合, 确定所 述目标元素的集合, 包括: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, determining the set of target elements based on the prediction information and the set of matching elements, include:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置。 Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the second predicted position information and the set of matching elements. The value and position of the first type element.
31、 根据权利要求 28所述的解码方法, 其特征在于, 当所述匹配元素 的集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的 集合, 包括: 31. The decoding method according to claim 28, characterized in that when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the a set of the prediction information and the matching elements, and determining a set of the target elements, including:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arrange in ascending or descending order of numerical value, predict identification and matching according to the element A set of elements, determine the values and positions of all target elements in the set of target elements.
32、 根据权利要求 29至 31 中任一项所述的解码方法, 其特征在于, 所述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息用于 指示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹配元 素的差值; 32. The decoding method according to any one of claims 29 to 31, wherein the prediction information further includes second prediction difference information, wherein the second prediction difference information is used to indicate the target The difference between the first type element in the palette and its matching element in the palette template;
所述根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数 目、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目标元素的 集合中的所述至少一个第一类元素, 包括: Determining the number of matching elements in the set of matching elements in the palette template, the second predicted position information and the set of matching elements, determining the number of matching elements in the set of target elements. At least one element of the first type, including:
根据所述第二预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the second prediction difference information.
33、 根据权利要求 2至 32中任一项所述的解码方法, 其特征在于, 所 述预测信息还包括预测指示信息, 所述预测指示信息用于指示所述目标调 色板中是否存在一个所述第一类元素能够根据所述预测信息与所述匹配元 素的集合而确定。 33. The decoding method according to any one of claims 2 to 32, characterized in that the prediction information further includes prediction indication information, and the prediction indication information is used to indicate whether there is one in the target palette. The first type of elements can be determined based on the set of the prediction information and the matching elements.
34、 根据权利要求 1至 33中任一项所述的解码方法, 其特征在于, 在 所述根据所述预测信息,确定在所述调色板模板中的匹配元素的集合之前, 还包括: 34. The decoding method according to any one of claims 1 to 33, characterized in that, before determining the set of matching elements in the palette template according to the prediction information, it further includes:
预设所述调色板模板。 Preset the palette template.
35、 根据权利要求 1至 34中任一项所述的解码方法, 其特征在于, 在 所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合 之后, 还包括: 35. The decoding method according to any one of claims 1 to 34, characterized in that, after determining the set of target elements based on the prediction information and the set of matching elements, it further includes:
根据所述目标元素的集合中的所述目标元素以及所述调色板模板中的 所述匹配元素对应的计数器数值, 更新所述调色板模板。 The palette template is updated according to the counter value corresponding to the target element in the set of target elements and the matching element in the palette template.
36、 根据权利要求 35所述的解码方法, 其特征在于, 所述更新所述调 色板模板包括: 36. The decoding method according to claim 35, wherein the updating of the palette template includes:
利用所述目标调色板中的所述至少一个第二类元素, 更新所述调色板 模板中所述非匹配元素的集合; Using the at least one second type element in the target palette, update the set of non-matching elements in the palette template;
利用所述目标调色板中的所述目标元素, 分别更新所述调色板模板中 与元素对应的计数器数值。 Using the target element in the target palette, the counter value corresponding to the element in the palette template is updated respectively.
37、 一种目标图像块的编码方法, 其特征在于, 包括: 37. A coding method for target image blocks, characterized by including:
构造目标调色板, 其中所述目标调色板是目标元素的集合, 所述目标 元素的集合中的每个目标元素是基于所述目标图像块的一个信号分量的釆 样点数值确定的具有代表性的数值, 其中所述目标元素的集合包括至少一 个第一类元素和 /或至少一个第二类元素,所述第一类元素是需要根据调色 板模板中的匹配元素确定的目标元素, 所述第二类元素无需根据调色板模 板中的匹配元素确定的目标元素; Constructing a target palette, wherein the target palette is a set of target elements, and each target element in the set of target elements is determined based on the sampling point value of a signal component of the target image block and has Representative values, wherein the set of target elements includes at least one first type element and/or at least one second type element, and the first type element is a target element that needs to be determined based on matching elements in the palette template , the second type of element does not need to be a target element determined based on the matching elements in the palette template;
确定所述目标调色板的预测信息, 并根据所述预测信息对所述目标调 色板进行预测编码, 以便确定所述目标调色板中的所述至少一个第一类元 素在所述调色板模板中的匹配元素的集合, 其中所述调色板模板由匹配元 素的集合和 /或非匹配元素的集合组成,所述匹配元素的集合包括至少一个 匹配元素, 所述匹配元素是用于匹配所述第一类元素的元素, 所述第一类 元素的数值与其匹配元素的数值之差的绝对值小于预定值, 所述非匹配元 素的集合包括至少一个非匹配元素, 所述非匹配元素是无法与所述第一类 元素匹配的元素; Determine prediction information of the target palette, and perform predictive coding on the target palette according to the prediction information, so as to determine whether the at least one first type element in the target palette is in the tone. A collection of matching elements in a palette template consisting of matching elements It consists of a set of elements and/or a set of non-matching elements. The set of matching elements includes at least one matching element. The matching element is an element used to match the first type of element. The value of the first type of element. The absolute value of the difference between the numerical values of its matching elements is less than a predetermined value, the set of non-matching elements includes at least one non-matching element, and the non-matching element is an element that cannot match the first type of element;
根据所述预测编码的目标调色板中所述目标元素的集合以及索引表, 对所述目标图像块进行编码。 The target image block is encoded according to the set of target elements and an index table in the predictively encoded target palette.
38、 根据权利要求 37所述的编码方法, 其特征在于, 所述预测信息包 括元素预测标识, 38. The encoding method according to claim 37, wherein the prediction information includes an element prediction identifier,
所述元素预测标识为所述调色板模板的预测标识, 其中所述调色板模 板的预测标识用于指示所述调色板模板中的所述匹配元素的集合与所述非 匹配元素的集合; 或者 The element prediction identification is a prediction identification of the palette template, wherein the prediction identification of the palette template is used to indicate the difference between the set of matching elements in the palette template and the non-matching element. collection; or
所述元素预测标识为所述调色板模板中元素的预测标识, 其中所述调 色板模板中元素的预测标识用于指示所述调色板模板中所述元素为匹配元 素或非匹配元素; 或者 The element prediction identification is the prediction identification of the element in the palette template, wherein the prediction identification of the element in the palette template is used to indicate that the element in the palette template is a matching element or a non-matching element. ; or
所述元素预测标识为所述目标调色板的预测标识, 其中所述目标调色 板的预测标识用于指示所述目标元素的集合中的第一类元素和 /或第二类 元素; 或者 The element prediction identification is a prediction identification of the target palette, wherein the prediction identification of the target palette is used to indicate a first type of element and/or a second type of element in the set of target elements; or
所述元素预测标识为所述目标调色板中元素的预测标识, 其中所述目 标调色板中目标元素的预测标识用于指示所述目标元素为第一类元素或第 二类元素; 或者 The element prediction identification is the prediction identification of the element in the target palette, wherein the prediction identification of the target element in the target palette is used to indicate that the target element is a first type element or a second type element; or
所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述匹 配元素的数目, 用于指示为所述目标调色板能够在所述调色板模板中找到 匹配元素的个数。 The element prediction identifier is the number of matching elements in the set of matching elements in the palette template, used to indicate that matching elements can be found in the palette template for the target palette. number.
39、 根据权利要求 38所述的编码方法, 其特征在于, 所述预测信息还 包括第一预测位置信息, 所述第一预测位置信息用于指示所述匹配元素的 集合分别对应的第一类元素在所述目标元素的集合中的位置; 或者 39. The encoding method according to claim 38, wherein the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the first category corresponding to the set of matching elements. The position of the element within the set of said target elements; or
所述预测信息还包括第二预测位置信息, 所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置。 The prediction information also includes second prediction position information, and the second prediction position information is used to indicate the position of the first type element corresponding to the matching element in the set of target elements.
40、 根据权利要求 38或 39所述的编码方法, 其特征在于, 40. The encoding method according to claim 38 or 39, characterized in that,
所述预测信息还包括第一索引信息, 其中所述第一索引信息用于指示 所述匹配元素的集合中全部匹配元素在所述调色板模板中的对应位置; 或 者 The prediction information also includes first index information, wherein the first index information is used to indicate the corresponding positions of all matching elements in the set of matching elements in the palette template; or
所述预测信息还包括第二索引信息, 其中所述第二索引信息用于指示 所述匹配元素在所述调色板模板中的对应位置。 The prediction information also includes second index information, where the second index information is used to indicate the corresponding position of the matching element in the palette template.
41、 根据权利要求 38至 40中任一项所述的编码方法, 其特征在于, 所述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于 指示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在 所述调色板模板中的匹配元素的差值; 或者 所述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息 用于指示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹 配元素的差值。 41. The encoding method according to any one of claims 38 to 40, wherein the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target The difference between each first-type element in the at least one first-type element in the palette and its matching element in the palette template; or The prediction information also includes second prediction difference information, wherein the second prediction difference information is used to indicate the first type of elements in the target palette and their matching elements in the palette template. difference.
42、 根据权利要求 38至 41 中任一项所述的编码方法, 其特征在于, 所述预测信息还包括预测指示信息, 所述预测指示信息用于指示所述目标 调色板中是否存在一个所述第一类元素能够根据所述预测信息与所述匹配 元素的集合而确定。 42. The encoding method according to any one of claims 38 to 41, characterized in that the prediction information further includes prediction indication information, and the prediction indication information is used to indicate whether there is a color in the target palette. The first type of elements can be determined based on the set of the prediction information and the matching elements.
43、 根据权利要求 37至 42中任一项所述的编码方法, 其特征在于, 在所述确定所述目标调色板的预测信息之前, 还包括: 43. The encoding method according to any one of claims 37 to 42, characterized in that, before determining the prediction information of the target palette, it further includes:
预设所述调色板模板。 Preset the palette template.
44、 根据权利要求 37至 43中任一项所述的编码方法, 其特征在于, 在所述根据所述预测信息对所述目标调色板进行预测编码之后, 还包括: 根据所述目标元素的集合中的所述目标元素以及所述调色板模板中的 所述匹配元素对应的计数器数值, 更新所述调色板模板。 44. The encoding method according to any one of claims 37 to 43, characterized in that, after performing predictive encoding on the target palette according to the prediction information, further comprising: The counter value corresponding to the target element in the set and the matching element in the palette template is updated to update the palette template.
45、 根据权利要求 44所述的编码方法, 其特征在于, 所述更新所述调 色板模板包括: 45. The encoding method according to claim 44, wherein the updating of the palette template includes:
利用所述目标调色板中的所述至少一个第二类元素, 更新所述调色板 模板中所述非匹配元素的集合; Using the at least one second type element in the target palette, update the set of non-matching elements in the palette template;
利用所述目标调色板中的所述目标元素, 更新所述调色板模板中与元 素对应的计数器数值。 Using the target element in the target palette, update the counter value corresponding to the element in the palette template.
46、 一种解码器, 其特征在于, 包括: 46. A decoder, characterized in that it includes:
接收单元, 用于从接收到的目标图像块的码流中获取目标调色板的预 测信息, 其中所述目标图像块是釆用调色板编码模式的图像块, 所述目标 调色板是目标元素的集合, 所述目标元素的集合中的每个目标元素是基于 所述目标图像块的一个信号分量的釆样点数值确定的具有代表性的数值, 其中所述目标元素的集合包括至少一个第一类元素和 /或至少一个第二类 元素, 所述第一类元素是需要根据调色板模板中的匹配元素确定的目标元 素, 所述第二类元素无需根据调色板模板中的匹配元素确定的目标元素; 第一确定单元, 用于根据所述接收单元接收的所述预测信息, 确定在 所述调色板模板中的匹配元素的集合, 其中所述调色板模板由匹配元素的 集合和 /或非匹配元素的集合组成,所述匹配元素的集合包括至少一个匹配 元素, 所述匹配元素是用于匹配所述第一类元素的元素, 所述第一类元素 的数值与其匹配元素的数值之差的绝对值小于预定值, 所述非匹配元素的 集合包括至少一个非匹配元素, 所述非匹配元素是无法与所述第一类元素 匹配的元素; The receiving unit is configured to obtain the prediction information of the target palette from the code stream of the received target image block, wherein the target image block is an image block using the palette encoding mode, and the target palette is A set of target elements, each target element in the set of target elements is a representative value determined based on the sampling point value of a signal component of the target image block, wherein the set of target elements includes at least A first-type element and/or at least one second-type element. The first-type element is a target element that needs to be determined based on the matching elements in the palette template. The second-type element does not need to be determined based on the matching elements in the palette template. The target element determined by the matching elements; a first determination unit, configured to determine a set of matching elements in the palette template according to the prediction information received by the receiving unit, wherein the palette template is composed of Composed of a set of matching elements and/or a set of non-matching elements, the set of matching elements includes at least one matching element, the matching element is an element used to match the first type of element, and the first type of element The absolute value of the difference between the numerical value and the numerical value of its matching elements is less than a predetermined value, the set of non-matching elements includes at least one non-matching element, and the non-matching element is an element that cannot match the first type of element;
第二确定单元, 用于根据所述预测信息与所述第一确定单元确定的所 述匹配元素的集合, 确定所述目标元素的集合; a second determination unit, configured to determine the set of target elements based on the prediction information and the set of matching elements determined by the first determination unit;
解码单元, 用于依据所述第二确定单元确定的所述目标元素的集合, 对所述目标图像块进行解码。 A decoding unit, configured to decode the target image block according to the set of target elements determined by the second determination unit.
47、 根据权利要求 46所述的解码器, 其特征在于, 所述预测信息包括 元素预测标识; 47. The decoder according to claim 46, wherein the prediction information includes an element prediction identifier;
所述第一确定单元用于: The first determining unit is used for:
根据所述元素预测标识,确定在所述调色板模板中的匹配元素的集合。 Based on the element prediction identification, a set of matching elements in the palette template is determined.
48、 根据权利要求 47所述的解码器, 其特征在于, 所述第一确定单元 具体用于: 48. The decoder according to claim 47, characterized in that the first determination unit is specifically used to:
当所述元素预测标识为所述调色板模板的预测标识, 根据所述调色板 模板的预 'j标识确定在所述调色板模板中的匹配元素的集合, 其中所述调 色板模板的预测标识用于指示所述调色板模板中的所述匹配元素的集合与 所述非匹配元素的集合。 When the element prediction identification is the prediction identification of the palette template, a set of matching elements in the palette template is determined according to the pre-identification of the palette template, wherein the palette The prediction identification of the template is used to indicate the set of matching elements and the set of non-matching elements in the palette template.
49、 根据权利要求 48所述的解码方法, 其特征在于, 当所述匹配元素 的集合为非空, 所述预测信息还包括第一预测位置信息, 所述第一预测位 置信息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元 素的集合中的位置; 49. The decoding method according to claim 48, wherein when the set of matching elements is non-empty, the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the The position of the first type element corresponding to the set of matching elements in the set of target elements;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板的预测标识、 所述第一预测位置信息和所述匹配 元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数 值及其位置; Determine the value and position of the at least one first type element in the set of target elements according to the prediction identification of the palette template, the first prediction position information and the set of matching elements;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
50、 根据权利要求 48所述的解码器, 其特征在于, 当所述匹配元素的 集合为非空, 所述预测信息还包括第一预测位置信息, 所述第一预测位置 信息用于指示所述匹配元素的集合分别对应的第一类元素在所述目标元素 的集合中的位置; 50. The decoder according to claim 48, wherein when the set of matching elements is non-empty, the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the The position of the first type element corresponding to the set of matching elements in the set of target elements;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述元素预测标识、 所述第一预测位置信息和所述匹配元素的集 合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值及其位 置。 According to the element prediction identifier, the first predicted position information and the set of matching elements, the value and position of the at least one first type element in the set of target elements are determined.
51、 根据权利要求 48所述的解码器, 其特征在于, 当所述匹配元素的 集合为非空, 当所述匹配元素的集合中匹配元素的个数少于或等于所述目 标元素的集合中目标元素的个数, 所述第二确定单元具体用于: 51. The decoder according to claim 48, wherein when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the set of target elements The number of target elements in , the second determination unit is specifically used to:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部所述目标元素的数值及其位 置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, the values and positions of all the target elements in the set of target elements are determined.
52、 根据权利要求 49至 51 中任一项所述的解码器, 其特征在于, 所 述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于指 示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在所 述调色板模板中的匹配元素的差值; 52. The decoder according to any one of claims 49 to 51, wherein the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target Each first-type element in the at least one first-type element in the palette and its location The difference between matching elements in the palette template;
所述第二确定单元还用于: The second determination unit is also used to:
根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the first prediction difference information.
53、 根据权利要求 47所述的解码器, 其特征在于, 所述第一确定单元 具体用于: 53. The decoder according to claim 47, characterized in that the first determining unit is specifically used to:
当所述元素预测标识为所述调色板模板中元素的预测标识, 依次根据 所述调色板模板中元素的预测标识确定在所述调色板模板中的匹配元素, 所确定的全部的所述匹配元素构成所述匹配元素的集合, 其中所述调色板 模板中元素的预测标识用于指示所述调色板模板中所述元素为匹配元素或 非匹配元素。 When the predicted identification of the element is the predicted identification of the element in the palette template, matching elements in the palette template are determined sequentially according to the predicted identification of the element in the palette template, and all the determined elements are The matching elements constitute a set of the matching elements, wherein the predicted identification of the elements in the palette template is used to indicate whether the element in the palette template is a matching element or a non-matching element.
54、 根据权利要求 53所述的解码器, 其特征在于, 当所述匹配元素的 集合为非空, 所述预测信息还包括第二预测位置信息, 所述第二预测位置 信息用于指示所述匹配元素对应的第一类元素在所述目标元素的集合中的 位置; 54. The decoder according to claim 53, wherein when the set of matching elements is non-empty, the prediction information further includes second prediction position information, and the second prediction position information is used to indicate the The position of the first type element corresponding to the matching element in the set of target elements;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板中元素的预测标识、 所述第二预测位置信,包、和所 述匹配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元 素的数值和位置; Determine the value of the at least one first type element in the set of target elements according to the predicted identification of the element in the palette template, the second predicted position information packet, and the set of matching elements. and location;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值和位置。 Obtain the value and position of the at least one second type element in the set of target elements from the code stream of the target image block.
55、 根据权利要求 53所述的解码器, 其特征在于, 当所述匹配元素的 集合为非空, 所述预测信息还包括第二预测位置信息, 所述第二预测位置 信息用于指示所述匹配元素对应的第一类元素在所述目标元素的集合中的 位置; 55. The decoder according to claim 53, wherein when the set of matching elements is non-empty, the prediction information further includes second prediction position information, and the second prediction position information is used to indicate the The position of the first type element corresponding to the matching element in the set of target elements;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板中元素的预测标识、 所述第二预测位置信,包、和所 述匹配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元 素的数值和位置。 Determine the value of the at least one first type element in the set of target elements according to the predicted identification of the element in the palette template, the second predicted position information packet, and the set of matching elements. and location.
56、 根据权利要求 53所述的解码器, 其特征在于, 当所述匹配元素的 集合为非空, 当所述匹配元素的集合中匹配元素的个数少于或等于所述目 标元素的集合中目标元素的个数, 所述第二确定单元具体用于: 56. The decoder according to claim 53, wherein when the set of matching elements is non-empty, when the number of matching elements in the set of matching elements is less than or equal to the set of target elements The number of target elements in , the second determination unit is specifically used to:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
57、 根据权利要求 54至 56中任一项所述的解码器, 其特征在于, 所 述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息用于指 示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹配元素 的差值; 57. The decoder according to any one of claims 54 to 56, wherein the prediction information further includes second prediction difference information, wherein the second prediction difference information is used to indicate the target The first type of element in the palette and its matching element in the palette template the difference;
所述第二确定单元还用于: The second determination unit is also used to:
根据所述第二预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the second prediction difference information.
58、 根据权利要求 47所述的解码器, 其特征在于, 所述预测信息还包 括第一索引信息, 其中所述第一索引信息用于指示所述匹配元素的集合中 全部匹配元素在所述调色板模板中的对应位置; 58. The decoder according to claim 47, wherein the prediction information further includes first index information, wherein the first index information is used to indicate that all matching elements in the set of matching elements are in the The corresponding position in the palette template;
所述第一确定单元具体用于: The first determining unit is specifically used for:
当所述元素预测标识为所述目标调色板的预测标识, 且所述目标调色 板的预测标识指示所述目标调色板中的所述至少一个第一类元素, 确定所 述调色板模板中由所述第一索引信息指示的对应位置的全部匹配元素构成 在所述调色板模板中的匹配元素的集合。 When the element prediction identification is the prediction identification of the target palette, and the prediction identification of the target palette indicates the at least one first type element in the target palette, determine the color adjustment All matching elements at corresponding positions indicated by the first index information in the plate template constitute a set of matching elements in the palette template.
59、 根据权利要求 58所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数少于所述目标元素的集合中目标元素的个数, 所述 第二确定单元具体用于: 59. The decoder according to claim 58, wherein when the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the second determining unit Specifically used for:
根据所述目标调色板的预测标识、 所述第一索引信息和所述匹配元素 的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和 位置; Determine the value and position of the at least one first type element in the set of target elements according to the predicted identification of the target palette, the first index information and the set of matching elements;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
60、 根据权利要求 58所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数等于所述目标元素的集合中目标元素的个数, 所述 第二确定单元具体用于: 60. The decoder according to claim 58, wherein when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the second determination unit specifically Used for:
根据所述目标调色板的预测标识、 所述第一索引信息和所述匹配元素 的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的数值和 位置。 Determine the value and position of the at least one first type element in the set of target elements according to the predicted identification of the target palette, the first index information and the set of matching elements.
61、 根据权利要求 58所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述第二确定单元具体用于: 61. The decoder according to claim 58, wherein when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the second Determine the unit specifically for:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
62、 根据权利要求 59至 61 中任一项所述的解码器, 其特征在于, 所 述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于指 示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在所 述调色板模板中的匹配元素的差值; 62. The decoder according to any one of claims 59 to 61, wherein the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target The difference between each first-type element in the at least one first-type element in the palette and its matching element in the palette template;
所述第二确定单元进一步用于: The second determination unit is further used for:
根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the first prediction difference information.
63、 根据权利要求 47所述的解码器, 其特征在于, 所述预测信息还包 括第二索引信息, 其中所述第二索引信息用于指示所述匹配元素在所述调 色板模板中的对应位置; 63. The decoder according to claim 47, characterized in that the prediction information also includes including second index information, wherein the second index information is used to indicate the corresponding position of the matching element in the palette template;
所述第一确定单元具体用于: The first determining unit is specifically used for:
当所述元素预测标识为所述目标调色板中元素的预测标识, 且所述目 标调色板中目标元素的预测标识用于指示所述目标元素为第一类元素, 依 次确定所述调色板模板中由所述第二索引信息指示的对应位置的匹配元 素, 所确定的全部所述匹配元素构成在所述调色板模板中的所述匹配元素 的集合。 When the element prediction identification is the prediction identification of the element in the target palette, and the prediction identification of the target element in the target palette is used to indicate that the target element is a first type element, the adjustment is determined in turn. The matching elements at the corresponding positions indicated by the second index information in the color palette template, and all the determined matching elements constitute a set of the matching elements in the palette template.
64、 根据权利要求 63所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数少于所述目标元素的集合中目标元素的个数, 所述 第二确定单元具体用于: 64. The decoder according to claim 63, wherein when the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the second determining unit Specifically used for:
根据所述目标调色板中元素的预测标识、 所述第二索引信,包、和所述匹 配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的 数值和位置; Determine the numerical sum of the at least one first type element in the set of target elements based on the predicted identification of the element in the target palette, the second index information packet, and the set of matching elements. Location;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
65、 根据权利要求 63所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数等于所述目标元素的集合中目标元素的个数, 所述 第二确定单元具体用于: 65. The decoder according to claim 63, wherein when the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the second determination unit specifically Used for:
根据所述目标调色板中元素的预测标识、 所述第二索引信,包、和所述匹 配元素的集合, 确定所述目标元素的集合中的所述至少一个第一类元素的 数值和位置。 Determine the numerical sum of the at least one first type element in the set of target elements based on the predicted identification of the element in the target palette, the second index information packet, and the set of matching elements. Location.
66、 根据权利要求 63所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述第二确定单元具体用于: 66. The decoder according to claim 63, wherein when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the second Determine the unit specifically for:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
67、 根据权利要求 64至 66中任一项所述的解码器, 其特征在于, 所 述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息用于指 示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹配元素 的差值; 67. The decoder according to any one of claims 64 to 66, wherein the prediction information further includes second prediction difference information, wherein the second prediction difference information is used to indicate the target The difference between the first type element in the palette and its matching element in the palette template;
所述第二确定单元进一步用于: The second determining unit is further used for:
根据所述第二预测差值信息, 调整确定所述目标元素的集合中的所述 至少一个第一类元素的数值。 According to the second prediction difference information, adjust the value of the at least one first type element in the set of target elements.
68、 根据权利要求 47所述的解码器, 其特征在于, 所述预测信息还包 括第一索引信息, 其中所述第一索引信息用于指示所述匹配元素的集合中 全部匹配元素在所述调色板模板中的对应位置; 68. The decoder according to claim 47, wherein the prediction information further includes first index information, wherein the first index information is used to indicate that all matching elements in the set of matching elements are in the The corresponding position in the palette template;
所述第一确定单元具体用于: The first determining unit is specifically used for:
当所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目, 且所述数目大于或等于 1 , 确定所述调色板模板中由所 述第一索引信息指示的对应位置的全部匹配元素构成所述调色板模板中的 匹配元素的集合, 其中所述调色板模板中所述匹配元素的集合中所述匹配 元素的数目用于指示为所述目标调色板能够在所述调色板模板中找到匹配 元素的个数。 When the element prediction is identified as described in the set of matching elements in the palette template The number of matching elements, and the number is greater than or equal to 1, determines that all matching elements at the corresponding positions indicated by the first index information in the palette template constitute a set of matching elements in the palette template , wherein the number of matching elements in the set of matching elements in the palette template is used to indicate the number of matching elements that can be found in the palette template for the target palette.
69、 根据权利要求 68所述的解码器, 其特征在于, 所述预测信息还包 括第一预测位置信息, 所述第一预测位置信息用于指示所述匹配元素的集 合分别对应的第一类元素在所述目标元素的集合中的位置; 69. The decoder according to claim 68, wherein the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the first category corresponding to the set of matching elements. The position of the element in the set of said target elements;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置; Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the first predicted position information and the set of matching elements. The value and position of the first type element;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
70、 根据权利要求 68所述的解码器, 其特征在于, 所述预测信息还包 括第一预测位置信息, 所述第一预测位置信息用于指示所述匹配元素的集 合分别对应的第一类元素在所述目标元素的集合中的位置; 70. The decoder according to claim 68, wherein the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the first category corresponding to the set of matching elements. The position of the element in the set of said target elements;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第一预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置。 Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the first predicted position information and the set of matching elements. The value and position of the first type element.
71、 根据权利要求 68所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述第二确定单元具体用于: 71. The decoder according to claim 68, wherein when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the second Determine the unit specifically for:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
72、 根据权利要求 69至 71 中任一项所述的解码器, 其特征在于, 所 述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于指 示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在所 述调色板模板中的匹配元素的差值; 72. The decoder according to any one of claims 69 to 71, wherein the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target The difference between each first-type element in the at least one first-type element in the palette and its matching element in the palette template;
所述第二确定单元还用于: The second determination unit is also used to:
根据所述第一预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the first prediction difference information.
73、 根据权利要求 47所述的解码器, 其特征在于, 所述预测信息还包 括第二索引信息, 其中所述第二索引信息用于指示所述匹配元素在所述调 色板模板中的对应位置; 73. The decoder according to claim 47, wherein the prediction information further includes second index information, wherein the second index information is used to indicate the position of the matching element in the palette template. Corresponding position;
所述第一确定单元具体用于: 当所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述 匹配元素的数目, 且所述数目大于或等于 1 , 依次确定所述调色板模板中 由所述第二索引信息指示的对应位置的匹配元素, 所确定的全部所述匹配 元素构成所述调色板模板中的匹配元素的集合, 其中所述调色板模板中所 述匹配元素的集合中所述匹配元素的数目用于指示为所述目标调色板能够 在所述调色板模板中找到匹配元素的个数。 The first determining unit is specifically used for: When the element prediction identifier is the number of matching elements in the set of matching elements in the palette template, and the number is greater than or equal to 1, determine in turn the number of matching elements in the palette template consisting of the The matching elements at corresponding positions indicated by the two index information, all the determined matching elements constitute a set of matching elements in the palette template, wherein the set of matching elements in the palette template is described in The number of matching elements is used to indicate the number of matching elements that can be found in the palette template for the target palette.
74、 根据权利要求 73所述的解码器, 其特征在于, 所述预测信息还包 括第二预测位置信息, 所述第二预测位置信息用于指示所述匹配元素对应 的第一类元素在所述目标元素的集合中的位置; 74. The decoder according to claim 73, wherein the prediction information further includes second prediction position information, and the second prediction position information is used to indicate where the first type element corresponding to the matching element is located. Describes the position of the target element in the collection;
当所述匹配元素的集合中匹配元素的个数少于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is less than the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置; Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the second predicted position information and the set of matching elements. The value and position of the first type element;
从所述目标图像块的码流中获取所述目标元素的集合中的所述至少一 个第二类元素的数值。 Obtain the value of the at least one second type element in the set of target elements from the code stream of the target image block.
75、 根据权利要求 73所述的解码器, 其特征在于, 所述预测信息还包 括第二预测位置信息, 所述第二预测位置信息用于指示所述匹配元素对应 的第一类元素在所述目标元素的集合中的位置; 75. The decoder according to claim 73, wherein the prediction information further includes second prediction position information, and the second prediction position information is used to indicate where the first type element corresponding to the matching element is located. Describes the position of the target element in the collection;
当所述匹配元素的集合中匹配元素的个数等于所述目标元素的集合中 目标元素的个数, 所述第二确定单元具体用于: When the number of matching elements in the set of matching elements is equal to the number of target elements in the set of target elements, the second determining unit is specifically used to:
根据所述调色板模板中所述匹配元素的集合中所述匹配元素的数目、 所述第二预测位置信息和所述匹配元素的集合, 确定所述目标元素的集合 中的所述至少一个第一类元素的数值和位置。 Determine the at least one of the set of target elements according to the number of the matching elements in the set of matching elements in the palette template, the second predicted position information and the set of matching elements. The value and position of the first type element.
76、 根据权利要求 73所述的解码器, 其特征在于, 当所述匹配元素的 集合中匹配元素的个数少于或等于所述目标元素的集合中目标元素的个 数, 所述第二确定单元具体用于: 76. The decoder according to claim 73, wherein when the number of matching elements in the set of matching elements is less than or equal to the number of target elements in the set of target elements, the second Determine the unit specifically for:
按照数值大小的升序或降序排列, 根据所述元素预测标识和所述匹配 元素的集合, 确定所述目标元素的集合中全部目标元素的数值及其位置。 Arranged in ascending or descending order of numerical magnitude, and based on the element prediction identifier and the set of matching elements, determine the values and positions of all target elements in the set of target elements.
77、 根据权利要求 74至 76中任一项所述的解码器, 其特征在于, 所 述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息用于指 示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹配元素 的差值; 77. The decoder according to any one of claims 74 to 76, wherein the prediction information further includes second prediction difference information, wherein the second prediction difference information is used to indicate the target The difference between the first type element in the palette and its matching element in the palette template;
所述第二确定单元还用于: The second determination unit is also used to:
根据所述第二预测差值信息, 调整所述目标元素的集合中的所述至少 一个第一类元素的数值。 Adjust the value of the at least one first type element in the set of target elements according to the second prediction difference information.
78、 根据权利要求 47至 77中任一项所述的解码器, 其特征在于, 所 述预测信息还包括预测指示信息, 所述预测指示信息用于指示所述目标调 色板中是否存在一个所述第一类元素能够根据所述预测信息与所述匹配元 素的集合而确定。 78. The decoder according to any one of claims 47 to 77, characterized in that the prediction information further includes prediction indication information, the prediction indication information is used to indicate whether there is one in the target palette. The first type of element can be matched with the matching element according to the prediction information Determined by the collection of elements.
79、 根据权利要求 46至 78中任一项所述的解码器, 其特征在于, 还 包括: 79. The decoder according to any one of claims 46 to 78, further comprising:
第一预设单元, 用于在所述根据所述预测信息, 确定在所述调色板模 板中的匹配元素的集合之前, 预设所述调色板模板。 A first preset unit configured to preset the palette template before determining a set of matching elements in the palette template based on the prediction information.
80、 根据权利要求 46至 79中任一项所述的解码器, 其特征在于, 还 包括: 80. The decoder according to any one of claims 46 to 79, further comprising:
第一更新单元,用于在所述根据所述预测信息与所述匹配元素的集合, 确定所述目标元素的集合之后, 根据所述目标元素的集合中的所述目标元 素以及所述调色板模板中的所述匹配元素对应的计数器数值, 更新所述调 色板模板。 A first update unit configured to, after determining the set of target elements based on the prediction information and the set of matching elements, based on the target elements in the set of target elements and the color adjustment The counter value corresponding to the matching element in the plate template is updated to update the palette template.
81、 根据权利要求 80所述的解码器, 其特征在于, 所述第一更新单元 具体用于: 81. The decoder according to claim 80, characterized in that the first update unit is specifically used for:
利用所述目标调色板中的所述至少一个第二类元素, 更新所述调色板 模板中所述非匹配元素的集合; Using the at least one second type element in the target palette, update the set of non-matching elements in the palette template;
利用所述目标调色板中的所述目标元素, 更新所述调色板模板中与元 素对应的计数器数值。 Using the target element in the target palette, update the counter value corresponding to the element in the palette template.
82、 一种编码器, 其特征在于, 包括: 82. An encoder, characterized in that it includes:
构造单元, 用于构造目标调色板, 其中所述目标调色板是目标元素的 集合, 所述目标元素的集合中的每个目标元素是基于所述目标图像块的一 个信号分量的釆样点数值确定的具有代表性的数值, 其中所述目标元素的 集合包括至少一个第一类元素和 /或至少一个第二类元素,所述第一类元素 是需要根据调色板模板中的匹配元素确定的目标元素, 所述第二类元素无 需根据调色板模板中的匹配元素确定的目标元素; 息, 并根据所述预测信息对所述目标调色板进行预测编码, 以便确定所述 目标调色板中的所述至少一个第一类元素在所述调色板模板中的匹配元素 的集合,其中所述调色板模板由匹配元素的集合和 /或非匹配元素的集合组 成, 所述匹配元素的集合包括至少一个匹配元素, 所述匹配元素是用于匹 配所述第一类元素的元素, 所述第一类元素的数值与其匹配元素的数值之 差的绝对值小于预定值,所述非匹配元素的集合包括至少一个非匹配元素, 所述非匹配元素是无法与所述第一类元素匹配的元素; A construction unit configured to construct a target palette, wherein the target palette is a set of target elements, and each target element in the set of target elements is based on a sample of a signal component of the target image block. A representative value determined by the point value, wherein the set of target elements includes at least one first type element and/or at least one second type element, and the first type element is required to match according to the palette template The target element determined by the element, the second type element does not need to be determined according to the target element in the palette template; information, and the target palette is predictively encoded according to the prediction information, so as to determine the a set of matching elements in the palette template for the at least one first type element in the target palette, wherein the palette template consists of a set of matching elements and/or a set of non-matching elements, The set of matching elements includes at least one matching element, the matching element is an element used to match the first type of element, and the absolute value of the difference between the numerical value of the first type element and the numerical value of its matching element is less than a predetermined value , the set of non-matching elements includes at least one non-matching element, and the non-matching element is an element that cannot match the first type of element;
编码单元, 用于根据所述预处理单元预测编码的目标调色板中所述目 标元素的集合以及索引表, 对所述目标图像块进行编码。 A coding unit, configured to code the target image block according to the set of target elements and the index table in the target palette predicted and encoded by the preprocessing unit.
83、 根据权利要求 82所述的编码器, 其特征在于, 所述预测信息包括 元素预测标识, 83. The encoder according to claim 82, wherein the prediction information includes an element prediction identifier,
所述元素预测标识为所述调色板模板的预测标识, 其中所述调色板模 板的预测标识用于指示所述调色板模板中的所述匹配元素的集合与所述非 匹配元素的集合; 或者 所述元素预测标识为所述调色板模板中元素的预测标识, 其中所述调 色板模板中元素的预测标识用于指示所述调色板模板中所述元素为匹配元 素或非匹配元素; 或者 The element prediction identification is a prediction identification of the palette template, wherein the prediction identification of the palette template is used to indicate the difference between the set of matching elements in the palette template and the non-matching element. collection; or The element prediction identification is the prediction identification of the element in the palette template, wherein the prediction identification of the element in the palette template is used to indicate that the element in the palette template is a matching element or a non-matching element. ; or
所述元素预测标识为所述目标调色板的预测标识, 其中所述目标调色 板的预测标识用于指示所述目标元素的集合中的第一类元素和 /或第二类 元素; 或者 The element prediction identification is a prediction identification of the target palette, wherein the prediction identification of the target palette is used to indicate a first type of element and/or a second type of element in the set of target elements; or
所述元素预测标识为所述目标调色板中元素的预测标识, 其中所述目 标调色板中目标元素的预测标识用于指示所述目标元素为第一类元素或第 二类元素; 或者 The element prediction identification is a prediction identification of an element in the target palette, wherein the prediction identification of the target element in the target palette is used to indicate that the target element is a first type element or a second type element; or
所述元素预测标识为所述调色板模板中所述匹配元素的集合中所述匹 配元素的数目, 用于指示为所述目标调色板能够在所述调色板模板中找到 匹配元素的个数。 The element prediction identifier is the number of matching elements in the set of matching elements in the palette template, used to indicate that matching elements can be found in the palette template for the target palette. number.
84、 根据权利要求 83所述的编码器, 其特征在于, 所述预测信息还包 括第一预测位置信息, 所述第一预测位置信息用于指示所述匹配元素的集 合分别对应的第一类元素在所述目标元素的集合中的位置; 或者 84. The encoder according to claim 83, wherein the prediction information further includes first prediction position information, and the first prediction position information is used to indicate the first category corresponding to the set of matching elements. The position of the element within the set of said target elements; or
所述预测信息还包括第二预测位置信息, 所述第二预测位置信息用于 指示所述匹配元素对应的第一类元素在所述目标元素的集合中的位置。 The prediction information also includes second prediction position information, and the second prediction position information is used to indicate the position of the first type element corresponding to the matching element in the set of target elements.
85、 根据权利要求 83或 84所述的编码器, 其特征在于, 85. The encoder according to claim 83 or 84, characterized in that,
所述预测信息还包括第一索引信息, 其中所述第一索引信息用于指示 所述匹配元素的集合中全部匹配元素在所述调色板模板中的对应位置; 或 者 The prediction information also includes first index information, wherein the first index information is used to indicate the corresponding positions of all matching elements in the set of matching elements in the palette template; or
所述预测信息还包括第二索引信息, 其中所述第二索引信息用于指示 所述匹配元素在所述调色板模板中的对应位置。 The prediction information also includes second index information, where the second index information is used to indicate the corresponding position of the matching element in the palette template.
86、 根据权利要求 83至 85中任一项所述的编码器, 其特征在于, 所 述预测信息还包括第一预测差值信息, 其中所述第一预测差值信息用于指 示所述目标调色板中所述至少一个第一类元素中每个第一类元素与其在所 述调色板模板中的匹配元素的差值; 或者 86. The encoder according to any one of claims 83 to 85, wherein the prediction information further includes first prediction difference information, wherein the first prediction difference information is used to indicate the target The difference between each first-type element in the at least one first-type element in the palette and its matching element in the palette template; or
所述预测信息还包括第二预测差值信息, 其中所述第二预测差值信息 用于指示所述目标调色板中所述第一类元素与其在所述调色板模板中的匹 配元素的差值。 The prediction information also includes second prediction difference information, wherein the second prediction difference information is used to indicate the first type of elements in the target palette and their matching elements in the palette template. difference.
87、 根据权利要求 83至 86中任一项所述的编码器, 其特征在于, 所 述预测信息还包括预测指示信息, 所述预测指示信息用于指示所述目标调 色板中是否存在一个所述第一类元素能够根据所述预测信息与所述匹配元 素的集合而确定。 87. The encoder according to any one of claims 83 to 86, wherein the prediction information further includes prediction indication information, and the prediction indication information is used to indicate whether there is one in the target palette. The first type of elements can be determined based on the set of the prediction information and the matching elements.
88、 根据权利要求 83至 87中任一项所述的编码器, 其特征在于, 还 包括: 88. The encoder according to any one of claims 83 to 87, further comprising:
第二预设单元, 用于在所述确定所述目标调色板的预测信息之前, 预 设所述调色板模板。 The second preset unit is configured to preset the palette template before determining the prediction information of the target palette.
89、 根据权利要求 82至 88中任一项所述的编码器, 其特征在于, 还 包括: 89. The encoder according to any one of claims 82 to 88, characterized in that, further include:
第二更新单元, 用于在所述根据所述预测信息对所述目标调色板进行 预测编码之后, 根据所述目标元素的集合中的所述目标元素以及所述调色 板模板中的所述匹配元素对应的计数器数值, 更新所述调色板模板。 A second update unit configured to perform predictive coding on the target palette based on the prediction information, based on the target elements in the set of target elements and all elements in the palette template. The counter value corresponding to the matching element is obtained, and the palette template is updated.
90、 根据权利要求 89所述的编码器, 其特征在于, 所述第二更新单元 具体用于: 90. The encoder according to claim 89, characterized in that the second update unit is specifically used for:
利用所述目标调色板中的所述至少一个第二类元素, 更新所述调色板 模板中所述非匹配元素的集合; Using the at least one second type element in the target palette, update the set of non-matching elements in the palette template;
利用所述目标调色板中的所述目标元素, 更新所述调色板模板中与元 素对应的计数器数值。 Using the target element in the target palette, update the counter value corresponding to the element in the palette template.
PCT/CN2014/082255 2013-07-15 2014-07-15 Target image block decoding and encoding method, and decoder and encoder WO2015007207A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310296647.9 2013-07-15
CN201310296647.9A CN104301737B (en) 2013-07-15 2013-07-15 The coding/decoding method of target image block and coding method and decoder and encoder

Publications (1)

Publication Number Publication Date
WO2015007207A1 true WO2015007207A1 (en) 2015-01-22

Family

ID=52321270

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082255 WO2015007207A1 (en) 2013-07-15 2014-07-15 Target image block decoding and encoding method, and decoder and encoder

Country Status (2)

Country Link
CN (1) CN104301737B (en)
WO (1) WO2015007207A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016169020A1 (en) * 2015-04-23 2016-10-27 Mediatek Singapore Pte. Ltd. A simplified coding method for palette coding

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016115728A1 (en) * 2015-01-23 2016-07-28 Mediatek Singapore Pte. Ltd. Improved escape value coding methods
CN105828079B (en) * 2015-01-27 2020-06-16 同济大学 Image processing method and device
WO2016119667A1 (en) * 2015-01-27 2016-08-04 同济大学 Image processing method and apparatus
EP3251358B1 (en) * 2015-01-29 2019-11-13 Canon Kabushiki Kaisha Palette predictor initializer when encoding or decoding self-contained coding structures
US10425659B2 (en) * 2015-01-30 2019-09-24 Qualcomm Incorporated Coding escape pixels for palette coding
US9900624B2 (en) 2015-02-05 2018-02-20 Mediatek Inc. Methods and apparatus of decoding process for palette syntax
EP3243330B1 (en) 2015-02-13 2021-10-27 MediaTek Inc. Method for palette syntax coding in video and image compression
CN107251555B (en) * 2015-02-17 2020-02-07 寰发股份有限公司 Method and apparatus for encoding and decoding video data
US10148981B2 (en) 2015-03-20 2018-12-04 Mediatek Singapore Pte. Ltd. Methods of palette coding with inter-prediction in video coding
SG11201708026TA (en) * 2015-04-08 2017-10-30 Hfi Innovation Inc Methods of palette mode coding in video coding
JP2018514142A (en) 2015-04-08 2018-05-31 寰發股▲ふん▼有限公司HFI Innovation Inc. Palette mode context encoding in video encoding and binarization method
WO2016176822A1 (en) * 2015-05-05 2016-11-10 Mediatek Inc. High-throughput coding method for palette coding
WO2016190627A1 (en) * 2015-05-27 2016-12-01 주식회사 케이티 Method and device for processing video signal
WO2016192053A1 (en) * 2015-06-03 2016-12-08 富士通株式会社 Copy information coding method and apparatus, and image processing device
US20160360205A1 (en) 2015-06-08 2016-12-08 Industrial Technology Research Institute Video encoding methods and systems using adaptive color transform
CN106303534B (en) * 2015-06-08 2022-05-31 上海天荷电子信息有限公司 Image compression method and device for multiple index string and pixel string fusion copy modes
US10148977B2 (en) 2015-06-16 2018-12-04 Futurewei Technologies, Inc. Advanced coding techniques for high efficiency video coding (HEVC) screen content coding (SCC) extensions

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0711069A1 (en) * 1994-11-04 1996-05-08 Canon Kabushiki Kaisha Image processing method and apparatus
CN200962655Y (en) * 2006-09-08 2007-10-17 上海尚茂电子技术有限公司 A motive image compression system for mobile device
CN101217668A (en) * 2008-01-14 2008-07-09 浙江大学 A mixed image compression method based on block classification

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0711069A1 (en) * 1994-11-04 1996-05-08 Canon Kabushiki Kaisha Image processing method and apparatus
CN200962655Y (en) * 2006-09-08 2007-10-17 上海尚茂电子技术有限公司 A motive image compression system for mobile device
CN101217668A (en) * 2008-01-14 2008-07-09 浙江大学 A mixed image compression method based on block classification

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WU, JING ET AL.: "Block Classification-Based Compression Method for Computer Screen Image", JOURNAL OF ZHEJIANG UNIVERSITY (ENGINEERING SCIENCE, vol. 43, no. 4, 15 April 2009 (2009-04-15) *
WU, JING: "Research On Method For Encoding Computer Screen Image Sequence", DOCTORAL DISSERTATION OF ZHEJIANG UNIVERSITY, 1 June 2009 (2009-06-01) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016169020A1 (en) * 2015-04-23 2016-10-27 Mediatek Singapore Pte. Ltd. A simplified coding method for palette coding

Also Published As

Publication number Publication date
CN104301737B (en) 2017-11-17
CN104301737A (en) 2015-01-21

Similar Documents

Publication Publication Date Title
WO2015007207A1 (en) Target image block decoding and encoding method, and decoder and encoder
US9743080B2 (en) Encoding or decoding method and apparatus
CN105684316B (en) Polar code encoding method and device
JP4085116B2 (en) Compression and decompression of image data in units of blocks
CN106815875B (en) Method and device for encoding and decoding information bitmap
US11106735B2 (en) Directed graph compression
US20150227686A1 (en) Lossless compression of dna sequences
US20220222861A1 (en) Method, device, and storage medium for data encoding/decoding
CN104754361A (en) Image encoding and decoding method and device
CN104579360B (en) A kind of method and apparatus of data processing
WO2021114100A1 (en) Intra-frame prediction method, video encoding and decoding methods, and related device
JP2012124679A (en) Apparatus and method for decoding encoded data
CN111602396B (en) Video image processing method, device and storage medium
WO2022179355A1 (en) Data processing method and apparatus for sample adaptive offset sideband compensating mode
CN102298782B (en) System and method for parameter estimation for lossless video compression
CN113556543B (en) Image compression method and device, electronic equipment and storage medium
CN102547267B (en) Video data decoding method and system
CN111953981A (en) Encoding method and device, and decoding method and device
CN114078170A (en) Method and device for decoding point cloud geometric isolated points
KR20130119781A (en) Apparatus and method for detecting video copy
CN104754346A (en) Image Processor
CN115002464A (en) Image coding method and device based on region of interest and storage medium
AU2014277750A1 (en) Encoding or decoding method and apparatus
KR20170031868A (en) Apparatus for binary data real time compressing method of classifying binary clusters topology based on their type and value

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14825833

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14825833

Country of ref document: EP

Kind code of ref document: A1