Picture-level mirroring and rotation for inter coded pictures

By applying picture-level mirroring and rotation techniques in video coding, the inefficiencies in existing standards are addressed, enhancing prediction and filtering processes to improve coding efficiency and quality.

WO2026158304A1PCT designated stage Publication Date: 2026-07-30MEDIATEK INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
MEDIATEK INC
Filing Date
2026-01-20
Publication Date
2026-07-30

AI Technical Summary

Technical Problem

Existing video coding standards like HEVC and VVC do not effectively handle picture-level rotation or mirroring in inter-predicted video coding, leading to inefficiencies in prediction and filtering processes.

Method used

Implementing picture-level mirroring and rotation in video coding by adjusting motion vectors, in-loop filtering, and predictor generation to account for orientation changes, using methods such as motion compensation and adaptive filtering.

Benefits of technology

Enhances prediction accuracy and filtering efficiency by aligning video blocks to their original orientation, improving coding performance and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026073700_30072026_PF_FP_ABST
    Figure CN2026073700_30072026_PF_FP_ABST
Patent Text Reader

Abstract

A method for coding video pictures with picture-level rotation or mirroring using inter-prediction is provided. A video coder receives data comprising a first picture that is coded with picture-level rotation or mirroring that transposes the first picture from an original orientation to a first orientation. The video coder performs picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation. The video coder stores the inverse-rotated or inverse-mirrored first picture in a reconstructed picture buffer. The video coder generates a predictor for a current block in a second picture by using the stored first picture, by transforming the motion vector and a collocated block in the first picture from the original orientation to a second orientation of the second picture. The video coder encodes or decodes the current block in the second picture by using the generated predictor.
Need to check novelty before this filing date? Find Prior Art

Description

PICTURE-LEVEL MIRRORING AND ROTATION FOR INTER CODED PICTURESCROSS REFERENCE TO RELATED PATENT APPLICATION (S)

[0001] The present disclosure is part of a non-provisional application that claims the priority benefit of U.S. Provisional Patent Application Nos. 63 / 747,394 and 63 / 780,560, filed on 21 January 2025 and 31 March 2025, respectively. Contents of above-listed applications are herein incorporated by reference.TECHNICAL FIELD

[0002] The present disclosure relates generally to video coding. In particular, the present disclosure relates to coding pictures with picture-level mirroring and rotation.BACKGROUND

[0003] Unless otherwise indicated herein, approaches described in this section are not prior art to the claims listed below and are not admitted as prior art by inclusion in this section.

[0004] High-Efficiency Video Coding (HEVC) is an international video coding standard developed by the Joint Collaborative Team on Video Coding (JCT-VC) . HEVC is based on the hybrid block-based motion-compensated DCT-like transform coding architecture. The basic unit for compression, termed coding unit (CU) , is a 2Nx2N square block of pixels, and each CU can be recursively split into four smaller CUs until the predefined minimum size is reached. Each CU contains one or multiple prediction units (PUs) .

[0005] Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Expert Team (JVET) of ITU-T SG16 WP3 and ISO / IEC JTC1 / SC29 / WG11. The input video signal is predicted from the reconstructed signal, which is derived from the coded picture regions. The prediction residual signal is processed by a block transform. The transform coefficients are quantized and entropy coded together with other side information in the bitstream. The reconstructed signal is generated from the prediction signal and the reconstructed residual signal after inverse transform on the de-quantized transform coefficients. The reconstructed signal is further processed by in-loop filtering for removing coding artifacts. The decoded pictures are stored in the frame buffer for predicting the future pictures in the input video signal.

[0006] In VVC, a coded picture is partitioned into non-overlapped square block regions represented by the associated coding tree units (CTUs) . The leaf nodes of a coding tree correspond to the coding units (CUs) . A coded picture can be represented by a collection of slices, each comprising an integer number of CTUs. The individual CTUs in a slice are processed in raster-scan order. A bi-predictive (B) slice may be decoded using intra prediction or inter prediction with at most two motion vectors (MVs) and reference indices to predict the sample values of each block. A predictive (P) slice is decoded using intra prediction or inter prediction with at most one motion vector and reference index to predict the sample values of each block. An intra (I) slice is decoded using intra prediction only.

[0007] A CTU can be partitioned into one or multiple non-overlapped coding units (CUs) using the quadtree (QT) with nested multi-type-tree (MTT) structure to adapt to various local motion and texture characteristics.

[0008] Each CU contains one or more prediction units (PUs) . The prediction unit, together with the associated CU syntax, works as a basic unit for signaling the predictor information. The specified prediction process is employed to predict the values of the associated pixel samples inside the PU. Each CU may contain one or more transform units (TUs) for representing the prediction residual blocks. A transform unit (TU) is comprised of a transform block (TB) of luma samples and two corresponding transform blocks of chroma samples and each TB correspond to one residual block of samples from one color component. An integer transform is applied to a transform block. The level values of quantized coefficients together with other side information are entropy coded in the bitstream. The terms coding tree block (CTB) , coding block (CB) , prediction block (PB) , and transform block (TB) are defined to specify the 2-D sample array of one-color component associated with CTU, CU, PU, and TU, respectively. Thus, a CTU consists of one luma CTB, two chroma CTBs, and associated syntax elements. A similar relationship is valid for CU, PU, and TU.

[0009] For each inter-predicted CU, motion parameters consisting of motion vectors, reference picture indices and reference picture list usage index, and additional information are used for inter-predicted sample generation. The motion parameter can be signalled in an explicit or implicit manner. When a CU is coded with skip mode, the CU is associated with one PU and has no significant residual coefficients, no coded motion vector delta or reference picture index. A merge mode is specified whereby the motion parameters for the current CU are obtained from neighbouring CUs, including spatial and temporal candidates, and additional schedules introduced in VVC. The merge mode can be applied to any inter-predicted CU. The alternative to merge mode is the explicit transmission of motion parameters, where motion vector, corresponding reference picture index for each reference picture list and reference picture list usage flag and other needed information are signalled explicitly per each CU.SUMMARY

[0010] The following summary is illustrative only and is not intended to be limiting in any way. That is, the following summary is provided to introduce concepts, highlights, benefits and advantages of the novel and non-obvious techniques described herein. Select and not all implementations are further described below in the detailed description. Thus, the following summary is not intended to identify essential features of the claimed subject matter, nor is it intended for use in determining the scope of the claimed subject matter.

[0011] Some embodiments of the disclosure provide a method for coding video pictures with picture-level rotation or mirroring using inter-prediction. A video coder receives data comprising a first picture that is coded with picture-level rotation or mirroring that transposes the first picture from an original orientation to a first orientation. The video coder reconstructs the first picture from the coded first picture. The video coder performs picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation. The video coder stores the inverse-rotated or inverse-mirrored first picture in a decoded picture buffer. The video coder generates a predictor for a current block in a second picture by using the stored first picture. The video coder encodes or decodes the current block in the second picture by using the generated predictor.

[0012] In some embodiments, the inverse-rotated  / mirrored first picture is applied in-loop filtering before being stored into the decoded picture buffer. The in-loop filtering includes at least one of deblocking filter (DBK) , sample adaptive offset (SAO) , adaptive loop filter (ALF) , and neural-network loop-filter (NNLF) . In some other embodiments, the in-loop filtering is applied to the reconstructed first picture before the inverse-rotation / mirroring, and the in-loop filtering is adaptively changed based on the picture-level mirroring and rotation that transposes the first picture from the original orientation to the first orientation.

[0013] In some embodiments, the predictor for the second picture is generated by a motion compensation process using a motion vector that locates a reference block in the first picture as a reference picture. The video coder generates the predictor for the second picture by transforming the motion vector and a collocated block in the first picture from the original orientation to a second orientation of the second picture (if the second picture is coded with picture-level mirroring / rotation. ) In some embodiments, the video coder transforms the motion vector and the collocated block by adjusting coordinates associated with the motion vector and the collocated block based a difference between the second orientation and the original orientation.

[0014] In some embodiments, the reference block is transposed based on a difference between the original orientation (of the reference picture) and the second orientation (of the second picture as the current picture) for generating the predictor of the second picture. For example, if the coordinate of the reference picture is rotated 90 / 180 / 270 degrees clockwise more than the coordinate of the current picture, the reference block after the motion compensation process may be rotated 90 / 180 / 270 degrees counterclockwise, and then used as a inter prediction of the current block.

[0015] In some embodiments, an order of a horizontal filtering and a vertical filtering in the motion compensation process is adjusted based on a difference between the second orientation and the original orientation. For example, if the original orientation (or the coordinate of the first picture as the reference picture) is rotated 90 degrees clockwise or 270 degrees clockwise relative to the second orientation (the coordinate of the second picture as the current picture) , the vertical filtering is performed before the horizontal filtering in the motion compensation process, otherwise the vertical filtering is performed after the horizontal filtering.BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are included to provide a further understanding of the present disclosure, and are incorporated in and constitute a part of the present disclosure. The drawings illustrate implementations of the present disclosure and, together with the description, serve to explain the principles of the present disclosure. It is appreciable that the drawings are not necessarily in scale as some components may be shown to be out of proportion than the size in actual implementation in order to clearly illustrate the concept of the present disclosure.

[0017] FIG. 1 conceptually illustrates chroma and luma samples that are used for derivation of linear model parameters.

[0018] FIG. 2 shows an example of classifying the neighbouring samples into two groups for MMLM.

[0019] FIG. 3 conceptually illustrates the spatial components of a convolutional filter.

[0020] FIG. 4, which shows the six neighboring non-downsampled luma samples.

[0021] FIG. 5 illustrates gradient filters enabled for Gradient Linear Model (GLM) .

[0022] FIG. 6 shows two diamond filter shapes that are used for ALF.

[0023] FIG. 7 provides a system level diagram of the CC-ALF process with respect to the SAO, luma ALF and chroma ALF processes.

[0024] FIG. 8 shows a diamond shaped filter for CC-ALF.

[0025] FIG. 9 illustrates a CCALF filter shape that is constructed by 23 luma spatial taps and 5 luma residual taps.

[0026] FIG. 10 shows ALF online-trained filters, which include 4 types of filter taps.

[0027] FIG. 11 shows a decoding workflow when CCSAO is applied.

[0028] FIG. 12 illustrates the candidate positions used for the CCSAO classifier.

[0029] FIG. 13 shows joint clipping after adding SAO / BIF / CCSAO offsets to the input sample.

[0030] FIG. 14 shows four 1-D directional patterns for CCSAO EO sample classification.

[0031] FIG. 15 illustrates a motion compensation (MC) process without picture level mirroring or rotation.

[0032] FIG. 16 illustrates an example MC adjustment when the coordinate of the reference picture is rotated 90-degrees clockwise.

[0033] FIG. 17 illustrates an example MC adjustment when the coordinate is rotated 180 degrees clockwise.

[0034] FIG. 18 illustrates an example MC adjustment when the coordinate is rotated 270 degrees clockwise.

[0035] FIG. 19 illustrates example MC adjustment when the coordinate is vertically mirrored.

[0036] FIG. 20 illustrates example MC adjustment when the coordinate is horizontally mirrored.

[0037] FIG. 21 illustrates the changed check patterns for edge-based classification in SAO / CCSAO when a current region is mirrored horizontally.

[0038] FIG. 22 illustrates the changed check patterns for edge-based classification in SAO / CCSAO when a current region is rotated 270 degrees clockwise.

[0039] FIG. 23 shows the Laplacian filters along four directions for deriving gradient-based classification for ALF when the current region is not mirrored nor rotated.

[0040] FIG. 24 shows the modified Laplacian filters along four directions for deriving gradient-based classification for ALF when the current region is mirrored horizontally.

[0041] FIG. 25 shows the modified Laplacian filters along four directions for deriving gradient-based classification for ALF when the current region is rotated 270 degrees clockwise.

[0042] FIG. 26 illustrates example symmetric filter shape in ALF for a current region that is not mirrored or rotated.

[0043] FIG. 27 illustrates example modified symmetric filter shape in ALF when the current region is horizontally mirrored.

[0044] FIG. 28 illustrates example modified symmetric filter shape in ALF when the current region is rotated 270 degrees clockwise.

[0045] FIG. 29 illustrates example asymmetrical filter shape for CCALF for a current region that is not mirrored or rotated.

[0046] FIG. 30 illustrates example modified asymmetrical filter shape for CCALF when the current region is horizontally mirrored.

[0047] FIG. 31 illustrates example modified asymmetrical filter shape for CCALF when the current region is rotated 270 degrees clockwise.

[0048] FIG. 32 illustrates shifting collocated position according to mirroring or rotation for when deriving a collocated luma sample for a current chroma sample.

[0049] FIG. 33 illustrates an example video encoder that may implement picture-level mirroring or rotation.

[0050] FIG. 34 illustrates portions of the video encoder that implement picture-level mirroring or rotation for inter-coded pictures.

[0051] FIG. 35 conceptually illustrates a process for encoding video pictures with picture-level mirroring and rotation.

[0052] FIG. 36 illustrates an example video decoder that may implement picture-level mirroring or rotation.

[0053] FIG. 37 illustrates portions of the video decoder that implement picture-level mirroring or rotation for inter-coded pictures.

[0054] FIG. 38 conceptually illustrates a process for decoding pictures with picture-level mirroring and rotation.

[0055] FIG. 39 conceptually illustrates an electronic system with which some embodiments of the present disclosure are implemented.DETAILED DESCRIPTION

[0056] In the following detailed description, numerous specific details are set forth by way of examples in order to provide a thorough understanding of the relevant teachings. Any variations, derivatives and / or extensions based on teachings described herein are within the protective scope of the present disclosure. In some instances, well-known methods, procedures, components, and / or circuitry pertaining to one or more example implementations disclosed herein may be described at a relatively high level without detail, in order to avoid unnecessarily obscuring aspects of teachings of the present disclosure. I. Cross-Component Prediction

[0057] A. Cross Component Linear Model (CCLM)

[0058] Cross Component Linear Model (CCLM) or Linear Model (LM) mode is a cross-component prediction mode in which chroma components of a block is predicted from the collocated reconstructed luma samples by linear models. The parameters (e.g., scale and offset) of the linear model are derived from already reconstructed luma and chroma samples that are adjacent to the block. For example, in VVC, the CCLM mode makes use of inter-channel dependencies to predict the chroma samples from reconstructed luma samples. This prediction is carried out using a linear model in the form of: P (i, j) =α·rec′L (i, j) +β      (1)

[0059] P (i, j) in eq. (1) represents the predicted chroma samples in a CU (or the predicted chroma samples of the current CU) and rec′L (i, j) represents the down-sampled reconstructed luma samples of the same CU (or the corresponding reconstructed luma samples of the current CU) .

[0060] The CCLM model parameters α (scaling parameter) and β (offset parameter) are derived based on at most four neighboring chroma samples and their corresponding down-sampled luma samples. In LM_Amode (also denoted as LM-T mode) , only the above or top-neighboring template is used to calculate the linear model coefficients. In LM_L mode (also denoted as LM-L mode) , only left template is used to calculate the linear model coefficients. In LM-LA mode (also denoted as LM-LT mode) , both left and above templates are used to calculate the linear model coefficients.

[0061] FIG. 1 conceptually illustrates chroma and luma samples that are used for derivation of linear model parameters. The figure illustrates a current block 100 having luma component samples and chroma component samples in 4: 2: 0 format. The luma and chroma samples neighboring the current block are reconstructed samples. These reconstructed samples are used to derive the cross-component linear model (parameters α and β) . Since the current block is in 4: 2: 0 format, the luma samples are down-sampled first before being used for linear model derivation. In the example, there are 16 pairs of reconstructed luma (down-sampled) and chroma samples neighboring the current block. These 16 pairs of luma versus chroma values are used to derive the linear model parameters.

[0062] To match the chroma sample locations for 4: 2: 0 video sequences, two types of down-sampling filters are applied to luma samples to achieve 2 to 1 down-sampling ratio in both horizontal and vertical directions. The selection of down-sampling filter is specified by a sequence parameter set (SPS) level flag. The two down-sampling filters are as follows, which correspond to “type-0” and “type-2” content, respectively. rec′L (i, j) = [recL (2i-1, 2j-1) +2*recL (2i, 2j-1) +recL (2i+1, 2j-1) +recL (2i-1, 2j) +2*recL (2i, 2j) +recL (2i+1, 2j) +4] >>3   (2) rec′L (i, j) = [recL (2i, 2j-1) +recL (2i-1, 2j) +4*recL (2i, 2j) +recL (2i+1, 2j) +recL (2i, 2j+1) +4] >>3       (3)

[0063] Note that only one luma line (general line buffer in intra prediction) is used to make the down-sampled luma samples when the upper reference line is at the CTU boundary. This parameter computation is performed as part of the decoding process, and is not just as an encoder search operation. As a result, no syntax is used to convey the α and β values to the decoder.

[0064] B. Multi-Model CCLM (MMLM)

[0065] Multiple model CCLM mode (MMLM) uses two models for predicting the chroma samples from the luma samples for the whole CU. In MMLM, neighbouring luma samples and neighbouring chroma samples of the current block are classified into two or more groups, each group is used as a training set to derive a linear model (i.e., a particular α and β are derived for a particular group) . FIG. 2 shows an example of classifying the neighbouring samples into two groups for MMLM. Furthermore, the samples of the current luma block are also classified based on the same rule for the classification of neighbouring luma samples. Predc [x, y] = α1×RecˊL [x, y] + β1 if Rec′L [x, y] ≤ Threshold Predc [x, y] = α2×RecˊL [x, y] + β2 if Rec′L [x, y] > Threshold

[0066] C. Convolutional Cross-Component Model (CCCM)

[0067] A convolutional cross-component model (CCCM) may be applied to improve the cross-component prediction performance. For some embodiment, the convolutional model has 7-tap filter having a 5-tap plus sign shape spatial component, a non-linear term and a bias term. The input to the spatial 5-tap component of the filter includes a center (C) luma sample (which is collocated with the chroma sample to be predicted) and the center luma sample’s above / north (N) , below / south (S) , left / west (W) and right / east (E) neighbors. FIG. 3 conceptually illustrates the spatial components of a convolutional filter. The nonlinear term (denoted as P) is represented as power of two of the center luma sample C and scaled to the sample value range of the content: P = (C*C + midVal ) >> bitDepth

[0068] Thus, for 10-bit content the non-linear term P is calculated as: P = (C*C + 512 ) >> 10

[0069] The bias term (denoted as B) represents a scalar offset between the input and output (similarly to the offset term in CCLM) and is set to middle chroma value (512 for 10-bit content) . Output of the filter is calculated as a convolution between the filter coefficients ci and the input values and clipped to the range of valid chroma samples: predChromaVal = c0C + c1N + c2S + c3E + c4W + c5P + c6B

[0070] D. CCCM using Non-Downsampled Luma Samples (NoSubCCCM)

[0071] In some embodiments, CCCM mode with 3x2 filter using non-downsampled luma samples (NoSubCCCM) is used. NoSubCCCM uses 6-tap spatial terms, four nonlinear terms and a bias term. The 6-tap spatial terms correspond to 6 neighboring luma samples (i.e., L0, L1, …, L5) around the chroma sample (i.e., C) to be predicted. FIG. 4, which shows the six neighboring non-downsampled luma samples L0, L1, …, L5. The four non-linear terms are derived from the samples L0, L1, L2, and L3 according to:

[0072] where αi is the coefficient, β is the offset. In some embodiments, NoSubCCCM is signaled as an additional CCCM model.

[0073] E. Gradient Linear Model (GLM)

[0074] For YUV 4: 2: 0 color format, a gradient linear model (GLM) method can be used to predict the chroma samples from luma sample gradients. Two modes are supported: a two-parameter GLM mode and a three-parameter GLM mode.

[0075] Compared with the CCLM, instead of down-sampled luma values, the two-parameter GLM utilizes luma sample gradients to derive the linear model. Specifically, when the two-parameter GLM is applied, the input to the CCLM process, i.e., the down-sampled luma samples L, are replaced by luma sample gradients G. C = α·G + β

[0076] The other parts of the CCLM (e.g., parameter derivation, prediction sample linear transform) are kept unchanged. In the three-parameter GLM, a chroma sample can be predicted based on both the luma sample gradients and down-sampled luma values with different parameters: C = α0·G + α1·L + α2·β

[0077] The model parameters of the three-parameter GLM are derived from 6 rows and columns adjacent samples by the LDL decomposition based MSE minimization method as used in the CCCM.

[0078] For signaling, when the CCLM mode is enabled to the current CU, one flag is signaled to indicate whether GLM is enabled for both Cb and Cr components; if the GLM is enabled, another flag is signaled to indicate which of the two GLM modes is selected and one syntax element is further signaled to select one of 4 gradient filters for the gradient calculation. FIG. 5 illustrates gradient filters enabled for Gradient Linear Model (GLM) , specifically, the figure illustrates four Sobel based gradient patterns 501-504 for GLM. II. In-Loop Filtering

[0079] A. Adaptive Loop Filter

[0080] In VVC, an Adaptive Loop Filter (ALF) with block-based filter adaption is applied. For the luma component, one among 25 filters is selected for each 4×4 block, based on the direction and activity of local gradients. FIG. 6 shows two diamond filter shapes that are used for ALF. The 7×7 diamond shape 610 is applied for luma component and the 5×5 diamond shape 620 is applied for chroma components.

[0081] For luma component, each 4x4 block is categorized into one out of 25 classes. Before filtering each 4×4 luma block, geometric transformations such as rotation or diagonal and vertical flipping are applied to the filter coefficients f (k, l) and to the corresponding filter clipping values c (k, l) depending on gradient values calculated for that block. This is equivalent to applying these transformations to the samples in the filter support region. The idea is to make different blocks to which ALF is applied more similar by aligning their directionality. For chroma components in a picture, no classification method is applied.

[0082] At decoder side, when ALF is enabled for a CTB, each sample R (i, j) within the CU is filtered, resulting in sample value R′ (i, j) as shown below,

[0083] where f (k, l) denotes the decoded filter coefficients, K (x, y) is the clipping function and c (k, l) denotes the decoded clipping parameters. The variable k and l vary between and where L denotes the filter length. The clipping function K (x, y) =min (y, max (-y, x) ) which corresponds to the function Clip3 (-y, y, x) . The clipping operation introduces non-linearity to make ALF more efficient by reducing the impact of neighbor sample values that are too different with the current sample value.

[0084] CC-ALF uses luma sample values to refine each chroma component by applying an adaptive, linear filter to the luma channel and then using the output of this filtering operation for chroma refinement. FIG. 7 shows placement of CC-ALF with respect to other loop filters, which provides a system level diagram of the CC-ALF process with respect to the SAO, luma ALF and chroma ALF processes. Filtering in CC-ALF is accomplished by applying a linear, diamond shaped filter to the luma channel. FIG. 8 shows a diamond shaped filter for CC-ALF.

[0085] One filter is used for each chroma channel, and the operation is expressed as

[0086] where (x, y) is chroma component i location being refined (xY, yY) is the luma location based on (x, y) , Si is filter support area in luma component, ci (x0, y0) represents the filter coefficients. As shown in FIG. 8, the luma filter support is the region collocated with the current chroma sample after accounting for the spatial scaling factor between the luma and chroma planes.

[0087] ALF filter parameters are signalled in Adaptation Parameter Set (APS) . In one APS, up to 25 sets of luma filter coefficients and clipping value indexes, and up to eight sets of chroma filter coefficients and clipping value indexes could be signalled. To reduce bits overhead, filter coefficients of different classification for luma component can be merged. In slice header, the indices of the APSs used for the current slice are signaled.

[0088] Clipping value indexes, which are decoded from the APS, allow determining clipping values using a table of clipping values for both luma and Chroma components. These clipping values are dependent of the internal bitdepth. More precisely, the clipping values are obtained by the following formula: AlfClip = {round (2B-a*n ) for n∈ [0.. N-1] }

[0089] with B equal to the internal bitdepth, a is a pre-defined constant value equal to 2.35, and N equal to 4 which is the number of allowed clipping values in VVC. The AlfClip is then rounded to the nearest value with the format of power of 2.

[0090] In slice header, up to 7 APS indices can be signaled to specify the luma filter sets that are used for the current slice. The filtering process can be further controlled at CTB level. A flag is always signalled to indicate whether ALF is applied to a luma CTB. A luma CTB can choose a filter set among 16 fixed filter sets and the filter sets from APSs. A filter set index is signaled for a luma CTB to indicate which filter set is applied. The 16 fixed filter sets are pre-defined and hard-coded in both the encoder and the decoder.

[0091] For chroma component, an APS index is signaled in slice header to indicate the chroma filter sets being used for the current slice. At CTB level, a filter index is signaled for each chroma CTB if there is more than one chroma filter set in the APS.

[0092] The filter coefficients are quantized with norm equal to 128. In order to restrict the multiplication complexity, a bitstream conformance is applied so that the coefficient value of the non-central position shall be in the range of -27 to 27 -1, inclusive. The central position coefficient is not signalled in the bitstream and is considered as equal to 128.

[0093] In some embodiments, ALF gradient subsampling and ALF virtual boundary processing are removed. Block size for classification is reduced from 4x4 to 2x2. Filter size for both luma and chroma, for which ALF coefficients are signalled, is increased.

[0094] In some embodiments, to filter a luma sample, three different classifiers (C0, C1 and C2) and three different sets of filters (F0, F1 and F2) are used. Sets F0 and F1 contain fixed filters, with coefficients trained for classifiers C0 and C1. Coefficients of filters in F2 are signalled. Which filter from a set Fi is used for a given sample is decided by a class Ci assigned to this sample using classifier Ci. The number of bits used to represent the fractional part of a luma coefficient is adaptive from 5 to 8, inclusively. For each luma filter set, which contains up to 25 filters, a 2-bit syntax element is signalled in APS to indicate the number of bits used for the coefficients in this set. The value range of a coefficient is not changed.

[0095] At first, two 13x13 diamond shape fixed filters F0 and F1 are applied to derive two intermediate samples R0 (x, y) and R1 (x, y) . After that, F2 is applied to R0 (x, y) , R1 (x, y) , and neighboring samples to derive a filtered sample as

[0096] where fi, j is the clipped difference between a neighboring sample and current sample R (x, y) and gi is the clipped difference between Ri-20 (x, y) and current sample. The filter coefficients ci, i=0, …21, are signalled.

[0097] Based on directionality Di and activity aclass Ci is assigned to each 2x2 block:

[0098] where MD, i represents the total number of directionalities Di. As in VVC, values of the horizontal, vertical, and two diagonal gradients are calculated for each sample using 1-D Laplacian. The sum of the sample gradients within a 4×4 window that covers the target 2×2 block is used for classifier C0 and the sum of sample gradients within a 12×12 window is used for classifiers C1 and C2. The sums of horizontal, vertical and two diagonal gradients are denoted, respectively, as and The directionality Di is determined by comparing

[0099] with a set of thresholds. The directionality D2 is derived as in VVC using thresholds 2 and 4.5. For D0 and D1 , horizontal / vertical edge strength and diagonal edge strength are calculated first. Thresholds Th= [1.25, 1.5, 2, 3, 4.5, 8] are used. Edge strength is 0 if Th [0] ; otherwise,  is the maximum integer such that Edge strength is 0 if otherwise,  is the maximum integer such that When  i.e., horizontal / vertical edges are dominant, the Di is derived by using Table 1 (a) ; otherwise, diagonal edges are dominant, the Di is derived by using Table 1 (b) . Table 1. Mapping of and to Di

[0100] To obtain the sum of vertical and horizontal gradients Ai is mapped to the range of 0 to n, where n is equal to 4 for and 15 for and

[0101] In an ALF_APS, up to 4 luma filter sets are signalled, each set may have up to 24 filters.

[0102] In some embodiments, classification in ALF is extended with an additional alternative classifier. For a signalled luma filter set, a flag is signalled to indicate whether the alternative classifier is applied. Geometrical transformation is not applied to the alternative band classifier. When the band-based classifier is applied, the sum of sample values of a 2x2 luma block is calculated at first. Then the class index is calculated as below, class_index = (sum *12) >> (sample bit depth + 2) .

[0103] A third classifier based on luma residual sample values. For each 2x2 luma block, the sum of absolute values of the residual samples in a neighbouring 8x8 window is calculated, and the class index is derived as: classIdx = sum >> (sample bit depth –3) .

[0104] The value of classIdx is in the range of 0 to 11, same as in ECM-8.0. The classifier usage is signaled for each luma filter set in APS.

[0105] For the online filters (signaled filters) , each 2×2 unit is classified into 2 noise levels according to the partitioning information. For a 2×2 unit, it is classified into noise level-1 if it is located at a CU or TU boundary, and into noise level-0 if it is not. The class number of existing classifiers is reduced from 25 to 12. For the texture-based classifier, the 25 classes are mapped to 12 classes with a pre-defined LUT. For the band-based and residual based classifiers, the 25 classes are decreased to 12 classes by enlarging the band width. These 12 classes are further combined with the proposed 2 noise levels to generate final 12×2 = 24 classes in total. The number of classifiers for online filters is kept as 3 and no additional encoder selection is introduced.

[0106] For the offline filters (fixed filters) , each 2×2 unit is classified into 2 noise levels in the same way as the classification of online filters. Besides, each 2×2 unit is further classified into 2 residual levels based on a predefined threshold also in the same way as the classifier of online filters. Furthermore, the generated offset of offline filters is adjusted based on the boundary level and residual level accordingly, where a stronger offset is applied on the positions at boundaries or with higher residuals.

[0107] In some embodiments, the CCALF process uses a linear filter to filter luma sample values, luma residual samples and generate a residual correction for the chroma samples. FIG. 9 illustrates a CCALF filter shape that is constructed by 23 luma spatial taps 910 and 5 luma residual taps 920. For a given slice, the encoder can collect the statistics of the slice, analyze them and can signal up to 16 filters through APS. The number of bits used to represent the fractional part of a CCALF coefficient can vary from 7 to 10 adaptively. FIG. 9 also illustrates a 3x3 asymmetric cross shape filter 930 that is added to handle chroma SAO output samples as additional input to CCALF.

[0108] FIG. 10 shows ALF online-trained filters, which include 4 types of filter taps: spatial taps 1010, fixed-filter-output based taps 1020, reconstruction-before-DBF based taps 1030, and residual based taps 1040. The fixed-filter-output based taps are extended, the residual based taps contain the clipped residual sample and the clipped residual sample filtered by the fixed filters, and the reconstruction-before-DBF (pre-DBF) based taps contain the clipped pre-DBF samples and the pre-DBF samples filtered by a Gaussian fixed filter. The shape of Gaussian fixed filter is a diamond 7x7 shape, and the filter parameters are stored at both encoder and decoder. There is no classification for this fixed filter.

[0109] In some embodiments, a scaling factor is signaled in slice header, the scaling factors is applied to the difference between the ALF input and ALF output, and the scaled residual is added to the ALF input (it produces a scaled ALF filtering) . A similar scaling process is applied to NN filtering in NNVC. Different luma scaling factors may be associated with different group of class indexes, and the ALF output is derived as follows: rec’ (s) = rec (s) + (corr (s) *tab [sfi [class (s) ] ] + 4 ) >> 3,

[0110] where ALF residual correction ‘corr (s) ’ is scaled using the scaling factor associated to the class index of the sample, ‘tab’ is the predefined LUT for mapping scaling index ‘sfi’ to scaling factor.

[0111] In some embodiments, two Laplacian-based classifiers (one for each fixed filter) are applied to a 2x2 block. In each classifier, activity and directionality values are derived based on vertical, horizontal, and diagonal gradients using a window surrounding each 2x2 block. For each 2x2 block, the mean value of a surrounding window is calculated. Then, for each sample of this window, the difference between the sample value and the mean value is calculated. A scaling factor is determined based on the activity value derived from a Laplacian classifier. The square root of the sum of the squared differences is further quantized to C′ by a scaling factor. The value of C′is an integer between 0 and 7, inclusively. With i=0, 1, let Ci denote the classifier from the classifier of i-th fixed filter. Then the proposed class index Ci′is derived as C′i = C′*896+Ci.

[0112] The total number of the fixed filters is not changed. Then a class index is determined based on the activity and directionality values. Two diamond shaped fixed filters are selected from the two filter sets by using the derived two class indices. Both fixed filters are applied to samples before DBF and ALF input, where additional diamond 9x9 filter is used for the samples before DBF. The shape of the first fixed filter applied to the ALF input samples is reduced from 13x13 to 9x9, and the shape of the second fixed filter, which is 13x13, applied to ALF input is unchanged as shown in the table below.

[0113] Fixed filter f1 is applied to outputs of f0 (instead of ALF input) and samples before DBF. Finally, a signalled filter is applied to the ALF input samples, samples before the deblocking filter (DBF) , outputs of the two fixed filters, output of a gaussian filter and the residual data.

[0114] In some embodiments, a classifier based on Laplacian values and variance is applied to a 2x2 chroma block. Compared to the luma classifier of a fixed filter, when calculating the activity value, the sum of the chroma vertical and horizonal Laplacian values is multiplied by 2 before scaling. Similarly, the chroma variance is multiplied by 2 before scaling. The derived class index is then used to select a fixed filter from a chroma filter set. A chroma fixed filter is applied to chroma ALF input samples in a 13x13 diamond shape and DBF input samples in a 7x7 diamond shape. The first luma classifier is applied to each 2x2 chroma block. The derived class index is then used to select a fixed filter from the luma fixed filter set related to this classifier. A fixed filter is applied to chroma ALF input sample in a 9x9 diamond shape and DBF input samples in a 9x9 diamond shape. In a signalled chroma filter, 5x5 crossing extra taps are introduced, which are applied to the fixed filter output.

[0115] B. Sample Adaptive Offset (SAO)

[0116] Cross-component Sample Adaptive Offset (CCSAO) is used to refine reconstructed chroma samples. Similarly to SAO, the CCSAO classifies the reconstructed samples into different categories, derives one offset for each category and adds the offset to the reconstructed samples in that category. However, different from SAO which only uses one single luma / chroma component of current sample as input, the CCSAO utilizes all three components to classify the current sample into different categories. To facilitate the parallel processing, the output samples from the de-blocking filter are used as the input of the CCSAO. FIG. 11 shows a decoding workflow when CCSAO is applied.

[0117] In CCSAO, only BO is used to enhance the quality of the reconstructed samples. For a given luma / chroma sample, three candidate samples are selected to classify the given sample into different categories: one collocated Y sample, one collocated U sample, and one collocated V sample. The sample values of these three selected samples are then classified into three different bands {bandY, bandU, bandV} , and a joint index i represents the category of the given sample. One offset is signaled and added to the reconstructed samples that fall into that category, which can be formulated as bandY = (Ycol·NY) >>BD bandU = (Ucol·NU) >>BD bandV = (Vcol·NV) >>BD i = bandY· (NU·NV) +bandU·NV+bandV C′rec = Clip1 (Crec+σCCSAO [i] )

[0118] where {Ycol , Ucol , Vcol } are the three selected collocated samples used to classify current sample; {NY, NU, NV} are the numbers of equally divided bands applied to {Ycol, Ucol, Vcol} full range respectively; BD is the internal coding bit-depth; Crec and C′rec are the reconstructed samples before and after the CCSAO is applied; σCCSAO [i] is the value of the CCSAO offset applied to i-th BO category. The collocated luma sample can be chosen from 9 candidate positions, while the collocated chroma sample positions are fixed, as depicted in FIG. 12, which illustrates the candidate positions used for the CCSAO classifier.

[0119] Similar to SAO, different classifiers can be applied to different local region to further enhance the whole picture quality. The parameters for each classifier (i.e., the position of Ycol, NY, NU, NV, and offsets) are signaled at picture level, and the classifier to be used is explicitly signaled and switched at CTB level. For each classifier, the maximum of {NY, NU, NV} is set to {16, 4, 4} , and offsets are constrained to be within the range [-15, 15] . At most 4 classifiers are used per frame.

[0120] In some embodiments, SAO, Bilateral filter (BIF) and CCSAO offset are computed in parallel, added to the reconstructed chroma samples and jointly clipped. FIG. 13 shows joint clipping after adding SAO / BIF / CCSAO offsets to the input sample.

[0121] Similar to the edge classifier of SAO in VVC the edge-based classifier of CCSAO also uses the four 1-D directional patterns for sample classification: horizontal, vertical, 135° diagonal and 45° diagonal. FIG. 14 shows four 1-D directional patterns for CCSAO EO sample classification: horizontal (EO class = 0) , vertical (EO class =1) , 135° diagonal and 45° diagonal. For every 1-D pattern, each sample is classified based on the sample difference between the luma sample value labeled as “c” and its two neighbor luma samples labeled as “a” and “b” along the selected 1-D pattern.

[0122] Similar to SAO, the encoder may decide the best 1-D directional pattern using the rate-distortion optimization (RDO) and signal this additional information in each classifier / set. Both the sample differences “a-c” and “b-c” are compared against a pre-defined threshold value (Th) to derive the final “class_idx” information.

[0123] The encoder selects the best “Th” value from an array of pre-defined threshold values based on RDO and the index into the “Th” array is signalled. Furthermore, an additional difference between CCSAO edge-based classifier and the SAO edge classifier in VVC is that, in the former, Chroma samples use the co-located Luma samples for deriving the edge information (samples “a” , “c” and “b” are the co-located luma samples) whereas, in the later Chroma samples use its own neighboring samples for deriving the edge information. In some embodiments, two edge-based classifiers are supported, and the edge-based classifier is decided by RDO and is signaled in slice header. The first edge-based classifier process is formulated as follows: Ea= (a-c<0) ? (a-c< (-Th) ? 0: 1) : (a-c< (Th) ? 2: 3) Eb= (b-c<0) ? (b-c< (-Th) ? 0: 1) : (b-c< (Th) ? 2: 3) class_idx = iB *16 + Ea *4 + Eb C′rec = Clip1 (Crec+σCCSAO [class_idx] )

[0124] variable “iB” is derived as follows. iB = (cur ·Ncur) >>BD (or) iB = (col1 ·Ncol1) >>BD (or) iB = (col2 ·Ncol2) >>BD

[0125] wherein, sample “cur” is the current sample being processed, col1 and col2 are the co-located samples. When Luma samples are processed, col1 and col2 are the co-located Cb and Cr samples respectively. When Chroma (Cb) samples are processed, col1 and col2 are the co-located Y and Cr samples respectively. Similarly When Chroma (Cr) samples are processed, col1 and col2 are the co-located Y and Cb samples respectively.

[0126] Based on RDO, encoder signals one among the samples “cur” , “col1" , "col2" used in deriving the band information.

[0127] The second edge-based classifier is a subset of the first edge-based classifier with less edge range divisions, and is formulated as follows: Ea= (a-c< (-Th) ? 0: 1) Eb= (b-c< (-Th) ? 0: 1) class_idx = iB *4 + Ea *2 + Eb C′rec = Clip1 (Crec+σCCSAO [class_idx] )

[0128] To reduce the signaling overhead, the CCASO offsets and classifier parameters can be inherited from previous coded pictures. A FIFO buffer is used to store the CCASO parameters. An index is signaled in slice header to indicate which candidate in the FIFO buffer is selected for the current slice. III. Picture-Level Mirroring and Rotation

[0129] Research indicates that it can be beneficial, in terms of coding efficiency, to rotate or mirror the input frame before encoding. Following modification could be applied to the input frame: ● vertical mirroring ● horizontal mirroring ● rotation by 90 degrees ● rotation by 90 degrees and horizontal mirroring ● rotation by 180 degrees ● rotation by 270 degrees ● rotation by 270 degrees and horizontal mirroring.

[0130] A. Component-level Mirroring and Rotation

[0131] In some embodiments, the luma component of a picture and the chroma components of a picture may have different picture-level mirroring and rotation settings. For one example, the luma component may be vertical-mirrored, and the chroma components may be rotated by 90 degrees. For another example, the luma component is rotated by 90 degrees, and the chroma components are rotated by 180 degrees. For another example, the luma component is vertical mirrored, and the chroma components are not modified. In some embodiments, the two chroma components of a picture may have different picture-level mirroring and rotation settings.

[0132] In some embodiments, one flag may be signaled in SPS, PPS, PH or SH to indicate whether the picture-level mirroring and rotation method is used or not. If the flag is true, one syntax may be further signaled in SPS, PPS, PH or SH to indicate which type of mirroring or rotation method is applied to the luma component of the picture, and another syntax could be further signaled in SPS, PPS, PH or SH to indicate which kind of mirroring or rotation method is applied to the chroma components of the picture.

[0133] In cross-component prediction, a cross-component down-sampling filter is applied to the luma reconstructed samples recL to obtain the down-sampled luma reconstructed samples with the same size as chroma, and the down-sampled luma reconstructed samples are used as the input of cross-component prediction models. In some embodiments, if a picture-level mirroring and rotation method is applied, the cross-component down-sampling filter are adjusted accordingly. For example, the position where the cross-component down-sampling filter is applied may be right shifted by one, the position where the cross-component down-sampling filter is applied may be moved down by one, the cross-component down-sampling filter could be rotated by 90 degrees clockwise, or the cross-component down-sampling filter could be rotated by 270 degrees clockwise.

[0134] In some embodiments, if the picture is vertically mirrored, the position where the cross-component down-sampling filter is applied may be right shifted by one. For example, if the original cross-component down-sampling filter is a 3*2 filter as the Eq. (2) , the luma reconstructed samples recL (i, j) are adjusted according to the following:

[0135] For another example, if the original cross-component down-sampling filter is a 3*3 diamond shape filter as Eq. (3) , the luma reconstructed samples recL may be adjusted according to the following:

[0136] In some embodiments, if the picture is horizontally mirrored, and the original cross-component down-sampling filter is a 3*2 filter as Eq. (2) , the position where the cross-component down-sampling filter is applied does not need to be adjusted.

[0137] In some embodiments, if the picture is horizontally mirrored, and the original cross-component down-sampling filter is a 3*3 diamond shape filter as Eq. (3) , the position where the cross-component down-sampling filter is applied could be moved down by one. For example, the 3*3 diamond shape filter could be adjusted according to the following:

[0138] In some embodiments, if the picture is rotated by 90 degrees clockwise, and the original cross-component down-sampling filter is a 3*2 filter as the Eq. (2) , the cross-component down-sampling filter could also be rotated by 90 degrees clockwise. For example, the filter may be rotated to a 2*3 filter as shown in the following:

[0139] In some embodiments, if the picture is rotated by 90 degrees clockwise, and the original cross-component down-sampling filter is a 3*3 diamond shape filter as Eq. (3) , the position where the cross-component down-sampling filter is applied could be right shifted by one. For example, the 3*3 diamond shape filter could be adjusted to the following:

[0140] In some embodiments, if the picture is rotated by 90 degrees clockwise and horizontally mirrored, and the original cross-component down-sampling filter is a 3*2 filter as the Eq. (2) , the cross-component down-sampling filter could also be rotated by 90 degrees clockwise. For example, the filter could be rotated to a 2*3 filter as shown in the following:

[0141] In some embodiments, if the picture is rotated by 90 degrees clockwise and horizontally mirrored, and the original cross-component down-sampling filter is a 3*3 diamond shape filter as the Eq. (3) , the position where the cross-component down-sampling filter is applied does not need to be adjusted.

[0142] In some embodiments, if the picture is rotated by 180 degrees clockwise, and the original cross-component down-sampling filter is a 3*2 filter as the Eq. (2) , the position where the cross-component down-sampling filter is applied could be right shifted by one. In some embodiments, if the picture is rotated by 180 degrees clockwise, and the original cross-component down-sampling filter is a 3*3 diamond shape filter as the Eq. (3) , the position where the cross-component down-sampling filter is applied could be right shifted by one and then moved down by one. For example, the 3*3 diamond shape filter could be adjusted to the following formula.

[0143] In some embodiments, if the picture is rotated by 270 degrees clockwise, and the original cross-component down-sampling filter is a 3*2 filter as the Eq. (2) , the cross-component down-sampling filter could also be rotated by 90 degrees clockwise and then moved down by one. For example, the filter could be rotated to a 2*3 filter as shown in the following:

[0144] In some embodiments, if the picture is rotated by 270 degrees clockwise, and the original cross-component down-sampling filter is a 3*3 diamond shape filter as the Eq. (3) , the position where the cross-component down-sampling filter is applied could be moved down by one. In some embodiments, if the picture is rotated by 270 degrees clockwise and horizontally mirrored, and the original cross-component down-sampling filter is a 3*2 filter as the Eq. (2) , the cross-component down-sampling filter could also be rotated by 90 degrees clockwise and then moved down by one. For example, the filter may be rotated to a 2*3 filter as shown in the following:

[0145] In some embodiments, if the picture is rotated by 270 degrees clockwise and horizontally mirrored, and the original cross-component down-sampling filter is a 3*3 diamond shape filter as the Eq. (3) , the position where the cross-component down-sampling filter is applied could be right shifted by one and then moved down by one.

[0146] In some embodiments, the cross-component down-sampling filter adjustment methods mentioned above may also be applied to the gradient down-sampling filter used in GLM mode. In some embodiments, the cross-component down-sampling filter adjustment methods mentioned above could also be applied to the filter kernel of the NoSubCCCM mode.

[0147] In some embodiments, the cross-component down-sampling filter adjustment could not depend on the picture-level mirroring and rotation. There could be a flag or syntax signaled in the SPS, PPS, PH or SH to indicate which cross-component down-sampling filter adjustment method is used for the current picture. For example, if the syntax is equal to the first value, the cross-component down-sampling filter is right shifted by one. If the syntax is equal to the second value, the cross-component down-sampling filter is moved down by one. If the syntax is equal to the third value, the cross-component down-sampling filter is right shifted by one and then moved down by one.

[0148] B. Inverse Picture-Level Mirroring and Rotation

[0149] In some embodiments, if picture-level mirroring and rotation is applied to the current picture, before storing the reconstructed samples to the decoded picture buffer (also called the reference picture buffer or reconstructed picture buffer, to be described by reference to FIGS. 33 and 36 below) , an inverse mirroring and rotation operation could be applied to generate the samples in the original orientation. For example, if the picture is horizontally or vertically mirrored, it may be horizontally or vertically mirrored again before being stored to the decoded picture buffer. For another example, if the picture was rotated by 90 degrees clockwise, the picture may be rotated by 90 degrees counterclockwise before being stored to the decoded picture buffer.

[0150] In some embodiments, if the picture-level mirroring and rotation is applied to the current picture, an inverse mirroring and rotation operation may be applied to generate the samples in the original orientation before the in-loop filter process described in Section II. The in-loop filter process may be deblocking filter, or SAO, or adaptive loop filter (ALF) , or neural-network loop-filter (NNLF) .

[0151] C. Motion Correlation and Picture-Level Mirroring and Rotation

[0152] For some embodiments, in the P picture or B picture, motion correlation methods may be used to determine the picture-level mirroring and rotation. In some embodiments, the collocated picture may be used for the motion correlation analysis. In some embodiments, the previous coded picture may be used for the motion correlation analysis. In some embodiments, the coded picture with the smallest slice QP may be used for the motion correlation analysis. In some embodiments, the coded picture with the lowest temporal layer may be used for the motion correlation analysis.

[0153] In some embodiments, motion correlation between the motion vector and the motion vectors from its neighbors in four directions (top-right, bottom-right, top-left, and bottom-left) may be calculated first. The direction with the highest correlation may be used to determine the picture-level mirroring and rotation. For example, if the motion vector has the highest correlation with the motion vector from the top-left, the current picture does not need to be adjusted. For another example, if the motion vector has the highest correlation with the motion vector from the top-right, the current picture may be rotated 270 degrees clockwise, or the current picture could be vertically mirrored. For another example, if the motion vector has the highest correlation with the motion vector from the bottom-left, the current picture could be rotated 90 degrees clockwise, or the current picture could be horizontally mirrored. For another example, if the motion vector has the highest correlation with the motion vector from the bottom-right, the current picture could be rotated 180 degrees clockwise.

[0154] D. Motion Compensation Adjustment with Picture-Level Mirroring and Rotation

[0155] For inter-frame prediction, if the picture-level mirroring and rotation is applied, the different pictures in volved in inter-frame prediction may be at different coordinates. In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, some adjustments to the MC process are introduced to handle the problem of different coordinates. Specifically, the motion vector in the reference picture and the coordinate of the collocated block may be adjusted.

[0156] FIG. 15 illustrates a motion compensation (MC) process without picture level mirroring or rotation. Assume that the top-left coordinate of the current block in the current picture is (x, y) , and the motion vector is (mvx, mvy) , when the different frames involved in inter-frame prediction have the same coordinates, the collocated block in the reference picture may be found by the top-left coordinate of the collocated block, which is the same as the top-left coordinate of the current block (x, y) . The reference block in the reference picture can be found by adding the motion vector to the top-left coordinate of the collocated block.

[0157] In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is rotated 90 degrees clockwise more than the coordinate of the current picture, the following adjustment may be introduced. The coordinate of the collocated block may be adjusted to (picH-y, x) , where picH is the height of the current picture. The motion vector in the reference picture could be adjusted to (-mvy, mvx) . The top-right coordinate of the reference block may be adjusted as (picH-y-mvy, x+mvx) , and the top-left coordinate of the reference block may be adjusted as (picH-y-mvy-blkH, x+mvx) , where blkH is the height of the current block. FIG. 16 illustrates an example MC adjustment when the coordinate of the reference picture is rotated 90-degrees clockwise.

[0158] In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is rotated 180 degrees clockwise more than the coordinate of the current picture, the following adjustment may be introduced. The coordinate of the collocated block could be adjusted to (picW-x, picH-y) , where picW is the width of the current picture. The motion vector in the reference picture could be adjusted to (-mvx, -mvy) . The bottom-right coordinate of the reference block may be adjusted as (picW-x-mvx, picH-y-mvy) , and the top-left coordinate of the reference block may be adjusted as (picW-x-mvx-blkW, picH-y-mvy-blkH) , where blkW is the width of the current block. FIG. 17 illustrates an example MC adjustment when the coordinate is rotated 180 degrees clockwise.

[0159] In some embodiment, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is rotated 270 degrees clockwise more than the coordinate of the current picture, the following adjustment could be introduced. The coordinate of the collocated block could be adjusted to (y, picW-x) . The motion vector in the reference picture may be adjusted to (mvy, -mvx) . The bottom-left coordinate of the reference block may adjusted as = (y+mvy, picW-x-mvx) , and the top-left coordinate of the reference block may be adjusted as (y+mvy, picW-x-mvx-blkW) . FIG. 18 illustrates an example MC adjustment when the coordinate is rotated 270 degrees clockwise.

[0160] In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is vertically mirrored with the coordinate of the current picture, the following adjustment could be introduced. The coordinate of the collocated block could be adjusted to (picW-x, y) . The motion vector in the reference picture could be adjusted to (-mvx, mvy) . The top-right coordinate of the reference block may be adjusted as (picW-x-mvx, y+mvy) , and the top-left coordinate of the reference block may be adjusted as (picW-x-mvx-blkW, y+mvy) . FIG. 19 illustrates example MC adjustment when the coordinate is vertically mirrored.

[0161] In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is horizontally mirrored with the coordinate of the current picture, the following adjustment could be introduced. The coordinate of the collocated block may be adjusted to (x, picH-y) . The motion vector in the reference picture may be adjusted to (mvx, -mvy) . The bottom-left coordinate of the reference block may be adjusted as (x+mvx, picH-y-mvy) , and the top-left coordinate of the reference block may be adjusted as (x+mvx, picH-y-mvy-blkH) . FIG. 20 illustrates example MC adjustment when the coordinate is horizontally mirrored.

[0162] In addition to adjusting the motion vector in the reference picture and the coordinate of the reference block, the order of the horizontal filtering and the vertical filtering in the MC process may also be adjusted. In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is rotated 90 degrees clockwise or 270 degrees clockwise more than the coordinate of the current picture, the vertical filtering may be performed before the horizontal filtering in the MC process. Otherwise, the processing order of the horizontal filtering and the vertical filtering in the MC process remains unchanged.

[0163] In some cases, the chroma phase of the current picture is different from the chroma phase of the reference picture. The chroma MC process may further consider the difference of the chroma phase to adjust the coordinate of the reference block. For example, in some embodiments, the chroma phase of the reference picture and the chroma phase of the current picture are the inputs of reference sample position derivation in chroma MC.

[0164] After the MC process, a reference block is obtained. If the coordinate of the current picture and the coordinate of the reference picture are different, the reference block may be adjusted accordingly before being used as a inter prediction of the current block. In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is rotated 90 / 180 / 270 degrees clockwise more than the coordinate of the current picture, the reference block after MC process may be rotated 90 / 180 / 270 degrees counterclockwise, and then used as a inter prediction of the current block.

[0165] In some embodiments, if the coordinate of the current picture and the coordinate of the reference picture are different, and the coordinate of the reference picture is vertically / horizontally mirrored with the coordinate of the current picture, the reference block after MC process may be vertically / horizontally mirrored, and then used as a inter prediction of the current block.

[0166] Any of the foregoing proposed methods can be implemented in encoders and / or decoders. For example, any of the proposed methods can be implemented in an inter / intra / prediction module of an encoder, and / or an inter / intra / prediction module of a decoder. Alternatively, any of the proposed methods can be implemented as a circuit coupled to the inter / intra / prediction module of the encoder and / or the inter / intra / prediction module of the decoder, so as to provide the information needed by the inter / intra / prediction module.

[0167] E. In-Loop Filtering with Picture-Level Mirroring and Rotation

[0168] Picture-level mirroring and rotation were introduced into codec to improve the video coding efficiency. However, such mirroring and rotation may lead to inconsistency in some operations in the in-loop filtering stage, such as SAO / CCSAO / ALF / CCALF classification, ALF / CCALF filtering, and cross-component derivation process in SAO / CCSAO / ALF / CCALF.

[0169] In some embodiments, mirroring or rotation is applied to a current region. When applying SAO or CCSAO to the current region, an edge-based classification is performed, where the class index derivation is adaptively changed according to the mirroring or the rotation. For example, if a current region is not mirrored or rotated, in SAO / CCSAO, the edge-based classification result is derived by applying four pattern checks to each sample as shown in FIG. 14 above, which illustrates the check patterns (classifiers 0-3) for edge-based classification in SAO / CCSAO when a current region is not mirror or rotated. The parameter ClassIndex is calculated according to the following: Ea = (a-c < 0) ? (a-c < (-Th) ? 0: 1) : (a-c < (Th) ? 2: 3) Eb = (b-c < 0) ? (b-c < (-Th) ? 0: 1) : (b-c < (Th) ? 2: 3) ClassIndex = Ea *4 + Eb

[0170] On the other hand, if the current region is mirrored or rotated, the four classifiers are changed. FIG. 21 illustrates the changed check patterns for edge-based classification in SAO / CCSAO when a current region is mirrored horizontally. FIG. 22 illustrates the changed check patterns for edge-based classification in SAO / CCSAO when a current region is rotated 270 degrees clockwise.

[0171] In some embodiments, mirroring or rotation is applied to a current region. When applying SAO or CCSAO to the current region, a band-based classification is performed, where the sample positions to use for classification are adaptively changed according to the mirroring or the rotation.

[0172] In some embodiments, if a current region is not mirrored or rotated, in CCSAO, the band-based classification result is derived by checking the sum of a group of samples near collocated samples. FIG. 12 above illustrates samples near collocated luma and chroma samples. Sample values for band-based classification may be selected among neighboring positions 0, 1, 2, 3, 5, 6, 7, and 8. Without loss of generality, let 0, 1, and 5 be selected. However, if another current region is mirrored or rotated, the selected positions may be mirrored or rotated as well. For example, if the current region is mirrored horizontally, position 1, 2, and 3 are selected instead of 0, 1, and 5. For another example, if the current region is rotated by 270 degrees (clockwise) , 1, 3, and 6 are selected instead of 0, 1, and 5.

[0173] For some embodiments, adaptive SAO / CCSAO edge-based classification based on picture-level mirroring and rotation and adaptive SAO / CCSAO band-based classification based on picture-level mirroring and rotation may be combined, resulting in an adaptive band-edge-based classifier (single classifier with band and edge information used) based on picture mirroring or rotation.

[0174] In some embodiments, when applying ALF or CCALF to a current region that is mirrored or rotated, a gradient-based (or Laplacian-based) classification is performed, and the filters used to collect horizontal, vertical, diagonal, and anti-diagonal gradients are adaptively changed according to the mirroring or the rotation. FIG. 23 shows the Laplacian filters along four directions for deriving gradient-based classification for ALF when the current region is not mirrored nor rotated. FIG. 24 shows the modified Laplacian filters along four directions for deriving gradient-based classification for ALF when the current region is mirrored horizontally. FIG. 25 shows the modified Laplacian filters along four directions for deriving gradient-based classification for ALF when the current region is rotated 270 degrees clockwise. For some embodiments, the Laplacian filter modifications for a rotated or mirrored region is also applicable to fixed filters for classification for ALF. In some embodiments, an adaptive look-up table is built for remapping the class-to-filter mapping without changing the filters used to collect horizontal, vertical, diagonal, and anti-diagonal gradients.

[0175] In some embodiments, adaptive ALF / CCALF filter shape based on picture-level mirroring and rotation is used. Specifically, when applying ALF or CCALF to a current region that is mirrored or rotated, a filter shape is used for all samples, where the spatial indexing of the shape is adaptively changed according to the mirroring or the rotation.

[0176] For ALF, the filter shape may be symmetrical. FIG. 26 illustrates example symmetric filter shape in ALF for a current region that is not mirrored or rotated. The example is of an ALF using multiple sources with 22 coefficients for pre-ALF taps, fixed filter related taps, and pre-DBF taps. However, if the current region is mirrored or rotated, the spatial indexing of the filter shape may be mirrored or rotated as well. FIG. 27 illustrates example modified symmetric filter shape in ALF when the current region is horizontally mirrored. FIG. 28 illustrates example modified symmetric filter shape in ALF when the current region is rotated 270 degrees clockwise.

[0177] For CCALF, the filter shape may be asymmetrical. FIG. 29 illustrates example asymmetrical filter shape for CCALF for a current region that is not mirrored or rotated. The figure shows an example of CCALF using multiple sources with 26 coefficients for luma and chroma taps. FIG. 30 illustrates example modified asymmetrical filter shape for CCALF when the current region is horizontally mirrored. FIG. 31 illustrates example modified asymmetrical filter shape for CCALF when the current region is rotated 270 degrees clockwise. Adaptive ALF / CCALF filter shapes based on picture-level mirroring and rotation as described by reference to FIGS. 26-31 above are also applicable to ALF fixed filtering.

[0178] In some embodiments, adaptive cross-component derivation process based on picture-level mirroring and rotation is used. Specifically, for a current region that is mirrored or rotated, when deriving a cross-component source for filtering the current region in an in-loop filter stage, a collocated sample of the cross-component is derived by sub-sampling, down-sampling, or up-sampling, where the sampling process is adaptively changed according to the mirroring or the rotation. For example, in some embodiments, in CCSAO, CCALF, or ALF-CCCM, luma component may be used for reconstructing a chroma component. When deriving a collocated luma sample for a current chroma sample, the collocated position is shifted by one pixel leftward, rightward, upward, or downward, according to the mirroring or the rotation. FIG. 32 illustrates shifting collocated position according to mirroring or rotation for when deriving a collocated luma sample for a current chroma sample. Specifically, FIG. 32 shows vertical mirroring. Position 7 is the collocated position, which may be derived by shifting 1 pixel upward. In contrast, FIG. 12 above shows collocated luma samples for a chroma sample without mirroring or rotation, in which position 4 is the collocated position.

[0179] Conversely, in some embodiments, in CCSAO or luma ALF, chroma components may be used for reconstructing the luma component, by e.g., fetching a collocated chroma sample or by up-sampling chroma samples, and the collocated position or the positions used for up-sampling are shifted by 1 pixel leftward, rightward, upward, or downward, according to the mirroring or the rotation. In some embodiments, if up-sampling or down-sampling is used, the filter may be adaptively selected according to the mirroring or the rotation.

[0180] In some embodiments, when mirroring or rotation is performed, for the filters used in classification and ALF / CCALF filtering, if the filters are symmetric, the filters are not adaptively changed. If the filters are asymmetric, the filters are adaptively changed according to the mirroring or the rotation. For example, ALF filters may be symmetric and therefore not adaptively changed according to the mirroring or the rotation. On the other hand, CCALF filters may be asymmetric and therefore adaptively changed according to the mirroring or the rotation.

[0181] For some embodiments, when mirroring or rotation is performed, for the filters used in classification and ALF / CCALF filtering, if geometric transformation is used for the filters, the filters are not adaptively changed according to the mirroring or the rotation; but if geometric transformation is not used for the filters, the filters are adaptively changed according to the mirroring and the rotation. For example, if gradient-based classification with geometric transformation is used for ALF, the filters used in classification and ALF filtering is not adaptively changed. On the other hand, if band-based classification without geometric transformation is used, the filters used in classification and ALF filtering is adaptively changed according to the mirroring or the rotation.

[0182] In some embodiments, the region may be mirrored or rotated back to the original before an in-loop filtering stage such as deblocking filtering, SAO / CCSAO / BIF, or ALF / CCALF, and a high-level flag could be signaled / parsed to indicate the in-loop filtering stage. For example, the current picture may be mirrored or rotated back to the original before deblocking filtering, or the current picture may be mirrored or rotated back to the original before ALF / CCALF. In some embodiments, the picture is mirrored or rotated back to the original before either deblocking filtering, SAO / CCSAO / BIF, or ALF / CCALF. A slice / picture-level flag is signaled / parsed to indicated which stage is selected. In some embodiments, for ALF / CCSAO, the mirroring or rotation information is signaled / parsed in the ALF / CCSAO APS if mirroring or rotation is applied to a current region. In some embodiments, the mirroring or rotation information is signaled / parsed in a slice / tile / sub-picture / picture header. For ALF / CCSAO, the classifier selection and filters / offsets are signaled / parsed in an ALF / CCSAO APS.

[0183] In some embodiments, when applying the ALF / CCSAO to a region in the slice / tile / sub-picture / picture, the classifiers and the filters / offsets are adaptively changed according to the signaled / parsed mirroring or rotation information. For example, in some embodiments, parameters in ALF / CCSAO APS are always for pictures without mirroring and rotation, and for each picture with mirroring or rotation, the parameters are adaptively changed. In some embodiments, when mirroring or rotation is applied to a current region, an in-loop filtering stage such as deblocking filtering, SAO / CCSAO / BIF, or ALF / CCALF may be performed normally without considering the mirroring or the rotation.

[0184] The foregoing proposed methods can be implemented in encoders and / or decoders. For example, the proposed method can be implemented in an in-loop filtering module of an encoder, and / or an in-loop filtering module of a decoder. IV. Example Video Encoder

[0185] FIG. 33 illustrates an example video encoder 3300 that may implement picture-level mirroring or rotation. As illustrated, the video encoder 3300 receives input video signal from a video source 3305 and encodes the signal into bitstream 3395. The video encoder 3300 has several components or modules for encoding the signal from the video source 3305, at least including some components selected from a transform module 3310, a quantization module 3311, an inverse quantization module 3314, an inverse transform module 3315, an intra estimation module 3324, an intra prediction module 3325, a motion compensation module 3330, a motion estimation module 3335, an in-loop filter 3345, a reconstructed picture buffer 3350, a MV buffer 3365, and a MV prediction module 3375, and an entropy encoder 3390. The motion compensation module 3330 and the motion estimation module 3335 are part of an inter-prediction module 3340. The intra-prediction module 3325 and the intra-estimation module 3324 are part of a current picture prediction module 3320, which uses current picture reconstructed samples as reference samples for prediction of the current block.

[0186] In some embodiments, the modules 3310 –3390 are modules of software instructions being executed by one or more processing units (e.g., a processor) of a computing device or electronic apparatus. In some embodiments, the modules 3310 –3390 are modules of hardware circuits implemented by one or more integrated circuits (ICs) of an electronic apparatus. Though the modules 3310 –3390 are illustrated as being separate modules, some of the modules can be combined into a single module.

[0187] The video source 3305 provides a raw video signal that presents pixel data of each video frame without compression. A subtractor 3308 computes the difference between the raw video pixel data of the video source 3305 and the predicted pixel data 3313 from the motion compensation module 3330 or intra-prediction module 3325 as prediction residual 3309. The transform module 3310 converts the difference (or the residual pixel data or residual signal 3309) into transform coefficients (e.g., by performing Discrete Cosine Transform, or DCT) . The quantization module 3311 quantizes the transform coefficients into quantized data (or quantized coefficients) 3312, which is encoded into the bitstream 3395 by the entropy encoder 3390.

[0188] The inverse quantization module 3314 de-quantizes the quantized data (or quantized coefficients) 3312 to obtain transform coefficients 3318, and the inverse transform module 3315 performs inverse transform on the transform coefficients 3318 to produce reconstructed residual 3319. The reconstructed residual 3319 is added with the predicted pixel data 3313 to produce reconstructed pixel data 3317. In some embodiments, the reconstructed pixel data 3317 is temporarily stored in a line buffer 3327 (or intra prediction buffer) for intra-picture prediction and spatial MV prediction. The reconstructed pixels are filtered by the in-loop filter 3345 and stored in the reconstructed picture buffer 3350. In some embodiments, the reconstructed picture buffer 3350 is a storage external to the video encoder 3300. In some embodiments, the reconstructed picture buffer 3350 is a storage internal to the video encoder 3300.

[0189] The intra estimation module 3324 derives intra-prediction data (e.g., intra prediction modes) based on the reconstructed pixel data 3317 (stored in the line buffer 3327) . The intra-prediction data is provided to the entropy encoder 3390 to be encoded into bitstream 3395. The intra-prediction data is also used by the intra-prediction module 3325 to produce the predicted pixel data 3313.

[0190] The motion estimation module 3335 performs inter-prediction by producing MVs to reference pixel data of previously decoded frames stored in the reconstructed picture buffer 3350. These MVs are provided to the motion compensation module 3330 to produce predicted pixel data.

[0191] Instead of encoding the complete actual MVs in the bitstream, the video encoder 3300 uses MV prediction to generate predicted MVs, and the difference between the MVs used for motion compensation and the predicted MVs is encoded as residual motion data and stored in the bitstream 3395.

[0192] The MV prediction module 3375 generates the predicted MVs based on reference MVs that were generated for encoding previously video frames, i.e., the motion compensation MVs that were used to perform motion compensation. The MV prediction module 3375 retrieves reference MVs from previous video frames from the MV buffer 3365. The video encoder 3300 stores the MVs generated for the current video frame in the MV buffer 3365 as reference MVs for generating predicted MVs.

[0193] The MV prediction module 3375 uses the reference MVs to create the predicted MVs. The predicted MVs can be computed by spatial MV prediction or temporal MV prediction. The difference between the predicted MVs and the motion compensation MVs (MC MVs) of the current frame (residual motion data) are encoded into the bitstream 3395 by the entropy encoder 3390.

[0194] The entropy encoder 3390 encodes various parameters and data into the bitstream 3395 by using entropy-coding techniques such as context-adaptive binary arithmetic coding (CABAC) or Huffman encoding. The entropy encoder 3390 encodes various header elements, flags, along with the quantized transform coefficients 3312, and the residual motion data as syntax elements into the bitstream 3395. The bitstream 3395 is in turn stored in a storage device or transmitted to a decoder over a communications medium such as a network.

[0195] The in-loop filter 3345 performs filtering or smoothing operations on the reconstructed pixel data 3317 to reduce the artifacts of coding, particularly at boundaries of pixel blocks. In some embodiments, the filtering or smoothing operations performed by the in-loop filter 3345 include deblock filter (DBF) , sample adaptive offset (SAO) , and / or adaptive loop filter (ALF) . In some embodiments, luma mapping chroma scaling (LMCS) is performed before the loop filters.

[0196] FIG. 34 illustrates portions of the video encoder 3300 that implement picture-level mirroring or rotation for inter-coded pictures. As illustrated, a mirror  / rotate module 3405 performs picture-level rotation or mirroring by transposing raw pixel data 3301 from the video source 3305 to generate rotated or mirrored raw pixel data 3401. The rotated or mirrored raw pixel data 3401 is provided to the inter prediction module 3340 for motion estimation and motion compensation, and to the subtractor 3308 as residual to be transformed by the transform module 3310. Thus, the transform (and inverse transform) operations and prediction operations are in a rotated / mirrored domain (or coordinate, or orientation) . The result of the transform and inverse transform operations (reconstructed residual 3319) and the result of the prediction operations (predicted pixel data 3313) are combined to become the reconstructed pixel data 3317, which is still in the rotated / mirrored domain. (The quantized coefficients 3312 into the bitstream 3395 are also in the rotated / mirrored domain. ) The reconstructed pixel data 3317 is transposed from the rotated / mirrored domain back to the original domain by an inverse mirror / rotate module 3410 before filtering by the in-loop filters 3345 and stored in the reconstructed picture buffer 3350.

[0197] The reconstructed picture buffer 3350 may be accessed by the inter-prediction module 3340 for motion compensation operations to generate predictors for subsequently coded pictures. Since the reconstructed pixel data stored in the reconstructed picture buffer 3350 are in the original domain / orientation while the operations of the inter-prediction module 3340 may be in a different domain / orientation for the picture being currently coded, a coordinate translation module 3420 is used to translate the coordinates of motion vectors, collocated blocks, or reference blocks from the original domain into a rotated / mirror domain of the current picture being inter-predicted. The translation of the coordinates for inter-prediction is performed based on the relative orientation between the original orientation and the mirrored / rotated orientation of the current picture. The translation of coordinates for picture-level mirroring / rotation is described further in Section III. D by reference to FIGS. 15-20.

[0198] In some other embodiments, at least some of the in-loop filters 3345 operate in the rotated / mirror domain, i.e., those in-loop filters operate on reconstructed pixel data 3317 without the inverse rotate / mirroring. In-loop filtering with picture-level mirroring  / rotating is described in Section III. D.

[0199] FIG. 35 conceptually illustrates a process 3500 for encoding video pictures with picture-level mirroring and rotation. In some embodiments, one or more processing units (e.g., a processor) of a computing device implementing the encoder 3300 performs the process 3500 by executing instructions stored in a computer readable medium. In some embodiments, an electronic apparatus implementing the encoder 3300 performs the process 3500.

[0200] The encoder receives (at block 3510) pixel data for a video in an original orientation to be encoded as a first picture of a video into a bitstream. The encoder encodes (at block 3520) the first picture with picture-level rotation and mirroring that transposes the first picture from an original orientation to a first orientation. The encoder reconstructs (at block 3530) the first picture from coded data of the first picture.

[0201] The encoder performs (at block 3540) picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation.

[0202] The encoder stores (at block 3550) the inverse-rotated or inverse-mirrored first picture with the restored original orientation in a reconstructed picture buffer (e.g., reconstructed picture buffer 3350) . In some embodiments, the inverse-rotated  / mirrored first picture is applied in-loop filtering before being stored into the reconstructed picture buffer. The in-loop filtering includes at least one of deblocking filter (DBK) , sample adaptive offset (SAO) , adaptive loop filter (ALF) , and neural-network loop-filter (NNLF) . In some other embodiments, the in-loop filtering is applied to the reconstructed first picture before the inverse-rotation / mirroring, and the in-loop filtering is adaptively changed based on the picture-level mirroring and rotation that transposes the first picture from the original orientation to the first orientation. In-loop filtering with picture-level mirroring / rotation is further described in Section III. E.

[0203] The encoder generates (at block 3560) a predictor for a current block in a second picture by using the stored first picture. In some embodiments, the predictor for the second picture is generated by a motion compensation process using a motion vector that locates a reference block in the first picture as a reference picture. The encoder generates the predictor for the second picture by transforming the motion vector and a collocated block in the first picture from the original orientation to a second orientation of the second picture (if the second picture is coded with picture-level mirroring / rotation. ) In some embodiments, the encoder transforms the motion vector and the collocated block by adjusting coordinates associated with the motion vector and the collocated block based a difference between the second orientation and the original orientation.

[0204] In some embodiments, the reference block is transposed based on a difference between the original orientation (of the reference picture) and the second orientation (of the second picture as the current picture) for generating the predictor of the second picture. For example, if the coordinate of the reference picture is rotated 90 / 180 / 270 degrees clockwise more than the coordinate of the current picture, the reference block after the motion compensation process may be rotated 90 / 180 / 270 degrees counterclockwise, and then used as a inter prediction of the current block.

[0205] In some embodiments, an order of a horizontal filtering and a vertical filtering in the motion compensation process is adjusted based on a difference between the second orientation and the original orientation. For example, if the original orientation (or the coordinate of the first picture as the reference picture) is rotated 90 degrees clockwise or 270 degrees clockwise relative to the second orientation (the coordinate of the second picture as the current picture) , the vertical filtering is performed before the horizontal filtering in the motion compensation process, otherwise the vertical filtering is performed after the horizontal filtering.

[0206] The encoder encodes (at block 3570) the current block in the second picture by using the generated predictor to produce prediction residuals. V. Example Video Decoder

[0207] In some embodiments, an encoder may signal (or generate) one or more syntax element in a bitstream, such that a decoder may parse said one or more syntax element from the bitstream.

[0208] FIG. 36 illustrates an example video decoder 3600 that may implement picture-level mirroring or rotation. As illustrated, the video decoder 3600 is an image-decoding or video-decoding circuit that receives a bitstream 3695 and decodes the content of the bitstream into pixel data of video frames for display. The video decoder 3600 has several components or modules for decoding the bitstream 3695, including some components selected from an inverse quantization module 3614, an inverse transform module 3615, an intra-prediction module 3625, a motion compensation module 3630, an in-loop filter 3645, a decoded picture buffer 3650, a MV buffer 3665, a MV prediction module 3675, and a parser 3690. The motion compensation module 3630 is part of an inter-prediction module 3640. The intra-prediction module 3625 is part of a current picture prediction module 3620, which uses current picture reconstructed samples as reference samples for prediction of the current block.

[0209] In some embodiments, the modules 3614 –3690 are modules of software instructions being executed by one or more processing units (e.g., a processor) of a computing device. In some embodiments, the modules 3614 –3690 are modules of hardware circuits implemented by one or more ICs of an electronic apparatus. Though the modules 3614 –3690 are illustrated as being separate modules, some of the modules can be combined into a single module.

[0210] The parser 3690 (or entropy decoder) receives the bitstream 3695 and performs initial parsing according to the syntax defined by a video-coding or image-coding standard. The parsed syntax element includes various header elements, flags, as well as quantized data (or quantized coefficients) 3612. The parser 3690 parses out the various syntax elements by using entropy-coding techniques such as context-adaptive binary arithmetic coding (CABAC) or Huffman encoding.

[0211] The inverse quantization module 3614 de-quantizes the quantized data (or quantized coefficients) 3612 to obtain transform coefficients, and the inverse transform module 3615 performs inverse transform on the transform coefficients 3618 to produce reconstructed residual signal 3619. The reconstructed residual signal 3619 is added with predicted pixel data 3613 from the intra-prediction module 3625 or the motion compensation module 3630 to produce decoded pixel data 3617. The decoded pixels data are filtered by the in-loop filter 3645 and stored in the decoded picture buffer 3650. In some embodiments, the decoded picture buffer 3650 is a storage external to the video decoder 3600. In some embodiments, the decoded picture buffer 3650 is a storage internal to the video decoder 3600.

[0212] The intra-prediction module 3625 receives intra-prediction data from bitstream 3695 and according to which, produces the predicted pixel data 3613 from the decoded pixel data 3617 stored in the decoded picture buffer 3650. In some embodiments, the decoded pixel data 3617 is also stored in a line buffer 3627 (or intra prediction buffer) for intra-picture prediction and spatial MV prediction.

[0213] In some embodiments, the content of the decoded picture buffer 3650 is used for display. A display device 3605 either retrieves the content of the decoded picture buffer 3650 for display directly, or retrieves the content of the decoded picture buffer to a display buffer. In some embodiments, the display device receives pixel values from the decoded picture buffer 3650 through a pixel transport.

[0214] The motion compensation module 3630 produces predicted pixel data 3613 from the decoded pixel data 3617 stored in the decoded picture buffer 3650 according to motion compensation MVs (MC MVs) . These motion compensation MVs are decoded by adding the residual motion data received from the bitstream 3695 with predicted MVs received from the MV prediction module 3675.

[0215] The MV prediction module 3675 generates the predicted MVs based on reference MVs that were generated for decoding previous video frames, e.g., the motion compensation MVs that were used to perform motion compensation. The MV prediction module 3675 retrieves the reference MVs of previous video frames from the MV buffer 3665. The video decoder 3600 stores the motion compensation MVs generated for decoding the current video frame in the MV buffer 3665 as reference MVs for producing predicted MVs.

[0216] The in-loop filter 3645 performs filtering or smoothing operations on the decoded pixel data 3617 to reduce the artifacts of coding, particularly at boundaries of pixel blocks. In some embodiments, the filtering or smoothing operations performed by the in-loop filter 3645 include deblock filter (DBF) , sample adaptive offset (SAO) , and / or adaptive loop filter (ALF) . In some embodiments, luma mapping chroma scaling (LMCS) is performed before the loop filters.

[0217] FIG. 37 illustrates portions of the video decoder 3600 that implement picture-level mirroring or rotation for inter-coded pictures. As illustrated, the bitstream 3695 may be coding pictures with picture-level mirroring or rotation. The quantized coefficients 3612 provided by the parser 3690 are processed by inverse transform operations to produce the reconstructed residual 3619, which is combined with predicted pixel data 3613 to become decoded pixel data 3617. The reconstructed residual 3619, the predicted pixel data 3613, and the decoded pixel data 3617 are all in the same rotated / mirrored domain as the coded picture in the bitstream 3695. The reconstructed pixel data 3617 is transposed from the rotated / mirrored domain back to the original domain by an inverse mirror / rotate module 3710 before filtering by the in-loop filters 3645 and storage in the decoded picture buffer 3650.

[0218] The decoded picture buffer 3650 may be accessed by the inter-prediction module 3640 for motion compensation operations to generate predictors for subsequently coded pictures. Since the reconstructed pixel data stored in the decoded picture buffer 3650 are in the original domain / orientation while the operations of the inter-prediction module 3640 may be in a different domain / orientation for the picture being currently coded, a coordinate translation module 3720 is used to translate the coordinates of motion vectors, collocated blocks, or reference blocks from the original domain into a rotated / mirror domain of the current picture being inter-predicted. The translation of the coordinates for inter-prediction is performed based on the relative orientation between the original orientation and the mirrored / rotated orientation of the current picture. The translation of coordinates for picture-level mirroring / rotation is described further in Section III. D by reference to FIGS. 15-20.

[0219] In some other embodiments, at least some of the in-loop filters 3645 operate in the rotated / mirror domain, i.e., those in-loop filters operate on reconstructed pixel data 3617 without the inverse rotate / mirroring. In-loop filtering with picture-level mirroring  / rotating is described in Section III. E.

[0220] FIG. 38 conceptually illustrates a process 3800 for decoding pictures with picture-level mirroring and rotation. In some embodiments, one or more processing units (e.g., a processor) of a computing device implementing the decoder 3600 performs the process 3800 by executing instructions stored in a computer readable medium. In some embodiments, an electronic apparatus implementing the decoder 3600 performs the process 3800.

[0221] The decoder receives (at block 3810) data comprising a first picture that is coded with picture-level rotation and mirroring that transposes the first picture from an original orientation to a first orientation. The decoder reconstructs (at block 3830) the first picture from coded data of the first picture. The decoder performs (at block 3840) picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation.

[0222] The decoder stores (at block 3850) the inverse-rotated or inverse-mirrored first picture with the restored original orientation in a decoded picture buffer (e.g., the decoded picture buffer 3650) . In some embodiments, the inverse-rotated  / mirrored first picture is applied in-loop filtering before being stored into the decoded picture buffer. The in-loop filtering includes at least one of deblocking filter (DBK) , sample adaptive offset (SAO) , adaptive loop filter (ALF) , and neural-network loop-filter (NNLF) . In some other embodiments, the in-loop filtering is applied to the reconstructed first picture before the inverse-rotation / mirroring, and the in-loop filtering is adaptively changed based on the picture-level mirroring and rotation that transposes the first picture from the original orientation to the first orientation. In-loop filtering with picture-level mirroring / rotation is further described in Section III. E.

[0223] The decoder generates (at block 3860) a predictor for a current block in a second picture by using the stored first picture. In some embodiments, the predictor for the second picture is generated by a motion compensation process using a motion vector that locates a reference block in the first picture as a reference picture. The decoder generates the predictor for the second picture by transforming the motion vector and a collocated block in the first picture from the original orientation to a second orientation of the second picture (if the second picture is coded with picture-level mirroring / rotation. ) In some embodiments, the decoder transforms the motion vector and the collocated block by adjusting coordinates associated with the motion vector and the collocated block based a difference between the second orientation and the original orientation.

[0224] In some embodiments, the reference block is transposed based on a difference between the original orientation (of the reference picture) and the second orientation (of the second picture as the current picture) for generating the predictor of the second picture. For example, if the coordinate of the reference picture is rotated 90 / 180 / 270 degrees clockwise more than the coordinate of the current picture, the reference block after the motion compensation process may be rotated 90 / 180 / 270 degrees counterclockwise, and then used as a inter prediction of the current block.

[0225] In some embodiments, an order of a horizontal filtering and a vertical filtering in the motion compensation process is adjusted based on a difference between the second orientation and the original orientation. For example, if the original orientation (or the coordinate of the first picture as the reference picture) is rotated 90 degrees clockwise or 270 degrees clockwise relative to the second orientation (the coordinate of the second picture as the current picture) , the vertical filtering is performed before the horizontal filtering in the motion compensation process, otherwise the vertical filtering is performed after the horizontal filtering.

[0226] The decoder reconstructs (at block 3870) the current block in the second picture by using the generated predictor and prediction residuals. The decoder may then provide the reconstructed current block for display or output as part of the reconstructed current picture. VI. Example Electronic System

[0227] Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium) . When these instructions are executed by one or more computational or processing unit (s) (e.g., one or more processors, cores of processors, or other processing units) , they cause the processing unit (s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, random-access memory (RAM) chips, hard drives, erasable programmable read only memories (EPROMs) , electrically erasable programmable read-only memories (EEPROMs) , etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.

[0228] In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the present disclosure. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.

[0229] FIG. 39 conceptually illustrates an electronic system 3900 with which some embodiments of the present disclosure are implemented. The electronic system 3900 may be a computer (e.g., a desktop computer, personal computer, tablet computer, etc. ) , phone, PDA, or any other sort of electronic device. Such an electronic system includes various types of computer readable media and interfaces for various other types of computer readable media. Electronic system 3900 includes a bus 3905, processing unit (s) 3910, a graphics-processing unit (GPU) 3915, a system memory 3920, a network 3925, a read-only memory 3930, a permanent storage device 3935, input devices 3940, and output devices 3945.

[0230] The bus 3905 collectively represents all system, peripheral, and chipset buses that communicatively connect the numerous internal devices of the electronic system 3900. For instance, the bus 3905 communicatively connects the processing unit (s) 3910 with the GPU 3915, the read-only memory 3930, the system memory 3920, and the permanent storage device 3935.

[0231] From these various memory units, the processing unit (s) 3910 retrieves instructions to execute and data to process in order to execute the processes of the present disclosure. The processing unit (s) may be a single processor or a multi-core processor in different embodiments. Some instructions are passed to and executed by the GPU 3915. The GPU 3915 can offload various computations or complement the image processing provided by the processing unit (s) 3910.

[0232] The read-only-memory (ROM) 3930 stores static data and instructions that are used by the processing unit (s) 3910 and other modules of the electronic system. The permanent storage device 3935, on the other hand, is a read-and-write memory device. This device is a non-volatile memory unit that stores instructions and data even when the electronic system 3900 is off. Some embodiments of the present disclosure use a mass-storage device (such as a magnetic or optical disk and its corresponding disk drive) as the permanent storage device 3935.

[0233] Other embodiments use a removable storage device (such as a floppy disk, flash memory device, etc., and its corresponding disk drive) as the permanent storage device. Like the permanent storage device 3935, the system memory 3920 is a read-and-write memory device. However, unlike storage device 3935, the system memory 3920 is a volatile read-and-write memory, such a random access memory. The system memory 3920 stores some of the instructions and data that the processor uses at runtime. In some embodiments, processes in accordance with the present disclosure are stored in the system memory 3920, the permanent storage device 3935, and / or the read-only memory 3930. For example, the various memory units include instructions for processing multimedia clips in accordance with some embodiments. From these various memory units, the processing unit (s) 3910 retrieves instructions to execute and data to process in order to execute the processes of some embodiments.

[0234] The bus 3905 also connects to the input and output devices 3940 and 3945. The input devices 3940 enable the user to communicate information and select commands to the electronic system. The input devices 3940 include alphanumeric keyboards and pointing devices (also called “cursor control devices” ) , cameras (e.g., webcams) , microphones or similar devices for receiving voice commands, etc. The output devices 3945 display images generated by the electronic system or otherwise output data. The output devices 3945 include printers and display devices, such as cathode ray tubes (CRT) or liquid crystal displays (LCD) , as well as speakers or similar audio output devices. Some embodiments include devices such as a touchscreen that function as both input and output devices.

[0235] Finally, as shown in FIG. 39, bus 3905 also couples electronic system 3900 to a network 3925 through a network adapter (not shown) . In this manner, the computer can be a part of a network of computers (such as a local area network ( “LAN” ) , a wide area network ( “WAN” ) , or an Intranet, or a network of networks, such as the Internet. Any or all components of electronic system 3900 may be used in conjunction with the present disclosure.

[0236] Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media) . Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM) , recordable compact discs (CD-R) , rewritable compact discs (CD-RW) , read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM) , a variety of recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc. ) , flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc. ) , magnetic and / or solid state hard drives, read-only and recordable  discs, ultra-density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.

[0237] While the above discussion primarily refers to microprocessor or multi-core processors that execute software, many of the above-described features and applications are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) . In some embodiments, such integrated circuits execute instructions that are stored on the circuit itself. In addition, some embodiments execute software stored in programmable logic devices (PLDs) , ROM, or RAM devices.

[0238] As used in this specification and any claims of this application, the terms “computer” , “server” , “processor” , and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. For the purposes of the specification, the terms display or displaying means displaying on an electronic device. As used in this specification and any claims of this application, the terms “computer readable medium, ” “computer readable media, ” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral signals.

[0239] While the present disclosure has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the present disclosure can be embodied in other specific forms without departing from the spirit of the present disclosure. In addition, a number of the figures (including FIG. 35 and FIG. 38) conceptually illustrate processes. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process. Thus, one of ordinary skill in the art would understand that the present disclosure is not to be limited by the foregoing illustrative details, but rather is to be defined by the appended claims. Additional Notes

[0240] The herein-described subject matter sometimes illustrates different components contained within, or connected with, different other components. It is to be understood that such depicted architectures are merely examples, and that in fact many other architectures can be implemented which achieve the same functionality. In a conceptual sense, any arrangement of components to achieve the same functionality is effectively "associated" such that the desired functionality is achieved. Hence, any two components herein combined to achieve a particular functionality can be seen as "associated with" each other such that the desired functionality is achieved, irrespective of architectures or intermediate components. Likewise, any two components so associated can also be viewed as being "operably connected" , or "operably coupled" , to each other to achieve the desired functionality, and any two components capable of being so associated can also be viewed as being "operably couplable" , to each other to achieve the desired functionality. Specific examples of operably couplable include but are not limited to physically mateable and / or physically interacting components and / or wirelessly interactable and / or wirelessly interacting components and / or logically interacting and / or logically interactable components.

[0241] Further, with respect to the use of substantially any plural and / or singular terms herein, those having skill in the art can translate from the plural to the singular and / or from the singular to the plural as is appropriate to the context and / or application. The various singular / plural permutations may be expressly set forth herein for sake of clarity.

[0242] Moreover, it will be understood by those skilled in the art that, in general, terms used herein, and especially in the appended claims, e.g., bodies of the appended claims, are generally intended as “open” terms, e.g., the term “including” should be interpreted as “including but not limited to, ” the term “having” should be interpreted as “having at least, ” the term “includes” should be interpreted as “includes but is not limited to, ” etc. It will be further understood by those within the art that if a specific number of an introduced claim recitation is intended, such an intent will be explicitly recited in the claim, and in the absence of such recitation no such intent is present. For example, as an aid to understanding, the following appended claims may contain usage of the introductory phrases "at least one" and "one or more" to introduce claim recitations. However, the use of such phrases should not be construed to imply that the introduction of a claim recitation by the indefinite articles "a" or "an" limits any particular claim containing such introduced claim recitation to implementations containing only one such recitation, even when the same claim includes the introductory phrases "one or more" or "at least one" and indefinite articles such as "a" or "an, " e.g., “a” and / or “an” should be interpreted to mean “at least one” or “one or more; ” the same holds true for the use of definite articles used to introduce claim recitations. In addition, even if a specific number of an introduced claim recitation is explicitly recited, those skilled in the art will recognize that such recitation should be interpreted to mean at least the recited number, e.g., the bare recitation of "two recitations, " without other modifiers, means at least two recitations, or two or more recitations. Furthermore, in those instances where a convention analogous to “at least one of A, B, and C, etc. ” is used, in general such a construction is intended in the sense one having skill in the art would understand the convention, e.g., “a system having at least one of A, B, and C” would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and / or A, B, and C together, etc. In those instances where a convention analogous to “at least one of A, B, or C, etc. ” is used, in general such a construction is intended in the sense one having skill in the art would understand the convention, e.g., “a system having at least one of A, B, or C” would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and / or A, B, and C together, etc. It will be further understood by those within the art that virtually any disjunctive word and / or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase “A or B” will be understood to include the possibilities of “A” or “B” or “A and B. ”

[0243] From the foregoing, it will be appreciated that various implementations of the present disclosure have been described herein for purposes of illustration, and that various modifications may be made without departing from the scope and spirit of the present disclosure. Accordingly, the various implementations disclosed herein are not intended to be limiting, with the true scope and spirit being indicated by the following claims.

Claims

1.A video coding method comprising:receiving data comprising a first picture that is coded with picture-level rotation or mirroring that transposes the first picture from an original orientation to a first orientation;reconstructing the first picture from the coded first picture,performing picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation;storing the inverse-rotated or inverse-mirrored first picture in a decoded picture buffer;generating a predictor for a current block in a second picture by using the stored first picture; andencoding or decoding the current block in the second picture by using the generated predictor.2.The video coding method of claim 1, wherein the inverse-rotated or inverse-mirrored first picture is applied in-loop filtering before being stored into the decoded picture buffer.3.The video coding method of claim 1, wherein the in-loop filtering comprises at least one of deblocking filter (DBK) , sample adaptive offset (SAO) , adaptive loop filter (ALF) , and neural-network loop-filter (NNLF) .4.The video coding method of claim 1, wherein the predictor for the second picture is generated by a motion compensation process using a motion vector that locates a reference block in the first picture.5.The video coding method of claim 4, wherein generating the predictor for the second picture comprises transforming the motion vector and a collocated block in the first picture from the original orientation to a second orientation of the second picture.6.The video coding method of claim 5, wherein transforming the motion vector and the collocated block comprises adjusting coordinates associated with the motion vector and the collocated block based a difference between the second orientation and the original orientation.7.The video coding method of claim 4, wherein the reference block is transposed based on a difference between the original orientation and the second orientation for generating the predictor of the second picture.8.The video coding method of claim 6, wherein an order of a horizontal filtering and a vertical filtering in the motion compensation process is adjusted based on a difference between the second orientation and the original orientation.9.The video coding method of claim 8, wherein if the original orientation is rotated 90 degrees clockwise or 270 degrees clockwise relative to the second orientation, the vertical filtering is performed before the horizontal filtering in the motion compensation process, otherwise the vertical filtering is performed after the horizontal filtering.10.The video coding method of claim 1, wherein in-loop filtering applied to the reconstructed first picture is adaptively changed based on the picture-level mirroring and rotation that transposes the first picture from the original orientation to the first orientation.11.An electronic apparatus comprising:a video coder circuit configured to perform operations comprising:receiving data comprising a first picture that is coded with picture-level rotation or mirroring that transposes the first picture from an original orientation to a first orientation;reconstructing the first picture from the coded first picture,performing picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation;storing the inverse-rotated or inverse-mirrored first picture in a decoded picture buffer;generating a predictor for a current block in a second picture by using the stored first picture; andencoding or decoding the current block in the second picture by using the generated predictor.12.A video decoding method comprising:receiving data comprising a first picture that is coded with picture-level rotation or mirroring that transposes the first picture from an original orientation to a first orientation;reconstructing the first picture from coded data of the first picture;performing picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation;storing the inverse-rotated or inverse-mirrored first picture in a decoded picture buffer;generating a predictor for a current block in a second picture by using the stored first picture; andreconstructing the current block in the second picture by using the generated predictor.13.A video encoding method comprising:receiving pixel data for a video in an original orientation to be encoded as a first picture of a video into a bitstream;encoding the first picture with picture-level rotation or mirroring that transposes the first picture from an original orientation to a first orientation;reconstructing the first picture from coded data of the first picture;performing picture-level inverse-rotating or inverse-mirroring on the reconstructed first picture to restore the original orientation;storing the inverse-rotated or inverse-mirrored first picture in a reconstructed picture buffer;generating a predictor for a current block in a second picture by using the stored first picture; andencoding the current block in the second picture by using the generated predictor.