History

avcodec/h264_cavlc: Remove code duplication

Andreas Rheinhardt committed 3 years ago

Commit ab8a8241 parent bd4c7781 file · +5 −12Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/h264_cavlc.c+5−12
@@ -419,20 +419,13 @@ static int decode_residual(const H264Context *h, H264SliceContext *sl, · 418 unmodified lines
419 else419 else
420 coeff_token = get_vlc2(gb, chroma422_dc_coeff_token_vlc_table,420 coeff_token = get_vlc2(gb, chroma422_dc_coeff_token_vlc_table,
421 CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 1);421 CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 1);
422 total_coeff= coeff_token>>2;
423 }else{422 }else{
424 if(n >= LUMA_DC_BLOCK_INDEX){423 total_coeff = pred_non_zero_count(h, sl, n >= LUMA_DC_BLOCK_INDEX ?
425 total_coeff= pred_non_zero_count(h, sl, (n - LUMA_DC_BLOCK_INDEX)*16);424 (n - LUMA_DC_BLOCK_INDEX) * 16 : n);
426 coeff_token = get_vlc2(gb, coeff_token_vlc[total_coeff],425 coeff_token = get_vlc2(gb, coeff_token_vlc[total_coeff],
427 COEFF_TOKEN_VLC_BITS, 2);426 COEFF_TOKEN_VLC_BITS, 2);
428 total_coeff= coeff_token>>2;
429 }else{
430 total_coeff= pred_non_zero_count(h, sl, n);
431 coeff_token = get_vlc2(gb, coeff_token_vlc[total_coeff],
432 COEFF_TOKEN_VLC_BITS, 2);
433 total_coeff= coeff_token>>2;
434 }
435 }427 }
428 total_coeff = coeff_token >> 2;
436 sl->non_zero_count_cache[scan8[n]] = total_coeff;429 sl->non_zero_count_cache[scan8[n]] = total_coeff;
437 430
438 //FIXME set last_non_zero?431 //FIXME set last_non_zero?

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t