Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d155b60f
Commit
d155b60f
authored
Jun 17, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flac: make FLAC_CHMODE_* constants consecutive
parent
93e7ef9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
15 deletions
+9
-15
flac.c
libavcodec/flac.c
+2
-1
flac.h
libavcodec/flac.h
+4
-4
flacenc.c
libavcodec/flacenc.c
+3
-10
No files found.
libavcodec/flac.c
View file @
d155b60f
...
...
@@ -55,8 +55,9 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
if
(
fi
->
ch_mode
<
FLAC_MAX_CHANNELS
)
{
fi
->
channels
=
fi
->
ch_mode
+
1
;
fi
->
ch_mode
=
FLAC_CHMODE_INDEPENDENT
;
}
else
if
(
fi
->
ch_mode
<
=
FLAC_CHMODE_MID_SIDE
)
{
}
else
if
(
fi
->
ch_mode
<
FLAC_MAX_CHANNELS
+
FLAC_CHMODE_MID_SIDE
)
{
fi
->
channels
=
2
;
fi
->
ch_mode
-=
FLAC_MAX_CHANNELS
-
1
;
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
+
log_level_offset
,
"invalid channel mode: %d
\n
"
,
fi
->
ch_mode
);
...
...
libavcodec/flac.h
View file @
d155b60f
...
...
@@ -37,10 +37,10 @@
#define FLAC_MIN_FRAME_SIZE 11
enum
{
FLAC_CHMODE_INDEPENDENT
=
0
,
FLAC_CHMODE_LEFT_SIDE
=
8
,
FLAC_CHMODE_RIGHT_SIDE
=
9
,
FLAC_CHMODE_MID_SIDE
=
10
,
FLAC_CHMODE_INDEPENDENT
=
0
,
FLAC_CHMODE_LEFT_SIDE
=
1
,
FLAC_CHMODE_RIGHT_SIDE
=
2
,
FLAC_CHMODE_MID_SIDE
=
3
,
};
enum
{
...
...
libavcodec/flacenc.c
View file @
d155b60f
...
...
@@ -1001,15 +1001,8 @@ static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n)
for
(
i
=
1
;
i
<
4
;
i
++
)
if
(
score
[
i
]
<
score
[
best
])
best
=
i
;
if
(
best
==
0
)
{
return
FLAC_CHMODE_INDEPENDENT
;
}
else
if
(
best
==
1
)
{
return
FLAC_CHMODE_LEFT_SIDE
;
}
else
if
(
best
==
2
)
{
return
FLAC_CHMODE_RIGHT_SIDE
;
}
else
{
return
FLAC_CHMODE_MID_SIDE
;
}
return
best
;
}
...
...
@@ -1081,7 +1074,7 @@ static void write_frame_header(FlacEncodeContext *s)
if
(
frame
->
ch_mode
==
FLAC_CHMODE_INDEPENDENT
)
put_bits
(
&
s
->
pb
,
4
,
s
->
channels
-
1
);
else
put_bits
(
&
s
->
pb
,
4
,
frame
->
ch_mode
);
put_bits
(
&
s
->
pb
,
4
,
frame
->
ch_mode
+
FLAC_MAX_CHANNELS
-
1
);
put_bits
(
&
s
->
pb
,
3
,
4
);
/* bits-per-sample code */
put_bits
(
&
s
->
pb
,
1
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment