History

audioconvert: use av_popcount64 in av_get_channel_layout_nb_channels

Anton Khirnov committed 14 years ago

Commit 3596de51 parent d7d071a1 file · +1 −5Browse files

Unified · Split

libavutil/audioconvert.c+1−5
@@ -175,11 +175,7 @@ void av_get_channel_layout_string(char *buf, int buf_size, · 174 unmodified lines
175175
176176 int av_get_channel_layout_nb_channels(uint64_t channel_layout)
177177 {
178− int count;
179− uint64_t x = channel_layout;
180− for (count = 0; x; count++)
181− x &= x-1; // unset lowest set bit
182− return count;
178+ return av_popcount64(channel_layout);
183179 }
184180
185181 uint64_t av_get_default_channel_layout(int nb_channels)

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