History

avcodec/mpegvideo_enc: Pass data_partitioning directly

This avoids having to store it in the backup MPVEncContext.

Andreas Rheinhardt committed 1 year ago

Commit f8360ed1 parent 1422f001 file · +5 −6Browse files

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

Unified · Split

libavcodec/mpegvideo_enc.c+5−6
@@ -2660,7 +2660,8 @@ static inline void copy_context_before_encode(MPVEncContext *const d, · 2659 unmodified lines
26602660 }
26612661
26622662 static inline void copy_context_after_encode(MPVEncContext *const d,
2663− const MPVEncContext *const s)
2663+ const MPVEncContext *const s,
2664+ int data_partitioning)
26642665 {
26652666 int i;
26662667
@@ -2684,7 +2685,7 @@ static inline void copy_context_after_encode(MPVEncContext *const d, · 17 unmodified lines
26842685 d->c.mv_type = s->c.mv_type;
26852686 d->c.mv_dir = s->c.mv_dir;
26862687 d->pb= s->pb;
2687− if (s->c.data_partitioning) {
2688+ if (data_partitioning) {
26882689 d->pb2= s->pb2;
26892690 d->tex_pb= s->tex_pb;
26902691 }
@@ -2744,7 +2745,7 @@ static void encode_mb_hq(MPVEncContext *const s, MPVEncContext *const backup, MP · 53 unmodified lines
27442745 *dmin= score;
27452746 *next_block^=1;
27462747
2747− copy_context_after_encode(best, s);
2748+ copy_context_after_encode(best, s, s->c.data_partitioning);
27482749 }
27492750 }
27502751
@@ -3165,8 +3166,6 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 414 unmodified lines
31653166
31663167 copy_context_before_encode(&backup_s, s);
31673168 backup_s.pb= s->pb;
3168− best_s.c.data_partitioning = s->c.data_partitioning;
3169− best_s.c.partitioned_frame = s->c.partitioned_frame;
31703169 if (s->c.data_partitioning) {
31713170 backup_s.pb2= s->pb2;
31723171 backup_s.tex_pb= s->tex_pb;
@@ -3390,7 +3389,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 217 unmodified lines
33903389 }
33913390 }
33923391
3393− copy_context_after_encode(s, &best_s);
3392+ copy_context_after_encode(s, &best_s, s->c.data_partitioning);
33943393
33953394 pb_bits_count= put_bits_count(&s->pb);
33963395 flush_put_bits(&s->pb);

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