Patent ID: 8335261

Claim:
A method comprising: selecting a variable length coding (VLC) table for a current video block from a plurality of tables based on a number of neighboring video blocks to the current video block that include non-zero transform coefficients, wherein selecting the VLC table comprises: calculating a table index value for the current video block based on the number of neighboring video blocks to the current video block that include non-zero transform coefficients; and selecting the VLC table based on the table index value, wherein the current video block comprises a 16 by 16 macroblock, and the neighboring video blocks comprise 8 by 8 luma blocks associated with a first neighboring macroblock left of the current video block and a second neighboring macroblock above the current video block, wherein the table index value is calculated as: N=(N(1)+N(u))/2+1 when information of non-zero transform coefficients exists for both the first neighboring macroblock and the second neighboring macroblock; N=N(1)+1 when information of non-zero transform coefficients exists for the first neighboring macroblock but not for the second neighboring macroblock; and N=N(u)+1 when information of non-zero transform coefficients exists for the second neighboring macroblock but not for the first neighboring macroblock, wherein N represents the table index value, N(1) represents a number of neighboring luma blocks left of the current video block that include non-zero transform coefficients and N(u) represents a number of neighboring luma blocks above the current video block that include non-zero transform coefficients; and coding one or more coded block patterns (CBPs) of the current video block using the selected VLC table.