Dirac: Removed goto + some code make up
(cherry picked from commit 8db434f8a6d210f7fd2f28ba325927d7a5dd04b9) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4bb2b5afc9
commit
aae7a5e36d
@ -547,8 +547,7 @@ static inline void intra_dc_prediction(SubBand *b)
|
|||||||
* Dirac Specification ->
|
* Dirac Specification ->
|
||||||
* 13.4.2 Non-skipped subbands. subband_coeffs()
|
* 13.4.2 Non-skipped subbands. subband_coeffs()
|
||||||
*/
|
*/
|
||||||
static av_always_inline
|
static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b, int is_arith)
|
||||||
void decode_subband_internal(DiracContext *s, SubBand *b, int is_arith)
|
|
||||||
{
|
{
|
||||||
int cb_x, cb_y, left, right, top, bottom;
|
int cb_x, cb_y, left, right, top, bottom;
|
||||||
DiracArith c;
|
DiracArith c;
|
||||||
@ -742,8 +741,8 @@ static void decode_lowdelay(DiracContext *s)
|
|||||||
buf = s->gb.buffer + get_bits_count(&s->gb)/8;
|
buf = s->gb.buffer + get_bits_count(&s->gb)/8;
|
||||||
bufsize = get_bits_left(&s->gb);
|
bufsize = get_bits_left(&s->gb);
|
||||||
|
|
||||||
for (slice_y = 0; slice_y < s->lowdelay.num_y; slice_y++)
|
for (slice_y = 0; bufsize > 0 && slice_y < s->lowdelay.num_y; slice_y++)
|
||||||
for (slice_x = 0; slice_x < s->lowdelay.num_x; slice_x++) {
|
for (slice_x = 0; bufsize > 0 && slice_x < s->lowdelay.num_x; slice_x++) {
|
||||||
bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||||
- slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
- slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||||
|
|
||||||
@ -755,10 +754,7 @@ static void decode_lowdelay(DiracContext *s)
|
|||||||
|
|
||||||
buf += bytes;
|
buf += bytes;
|
||||||
bufsize -= bytes*8;
|
bufsize -= bytes*8;
|
||||||
if (bufsize <= 0)
|
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
end:
|
|
||||||
|
|
||||||
avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num,
|
avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num,
|
||||||
sizeof(struct lowdelay_slice)); /* [DIRAC_STD] 13.5.2 Slices */
|
sizeof(struct lowdelay_slice)); /* [DIRAC_STD] 13.5.2 Slices */
|
||||||
@ -1581,7 +1577,8 @@ static int dirac_decode_frame_internal(DiracContext *s)
|
|||||||
|
|
||||||
dsty = -p->yoffset;
|
dsty = -p->yoffset;
|
||||||
for (y = 0; y < s->blheight; y++) {
|
for (y = 0; y < s->blheight; y++) {
|
||||||
int h = 0, start = FFMAX(dsty, 0);
|
int h = 0,
|
||||||
|
start = FFMAX(dsty, 0);
|
||||||
uint16_t *mctmp = s->mctmp + y*rowheight;
|
uint16_t *mctmp = s->mctmp + y*rowheight;
|
||||||
DiracBlock *blocks = s->blmotion + y*s->blwidth;
|
DiracBlock *blocks = s->blmotion + y*s->blwidth;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user