project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void sysctl_write(void *opaque, target_phys_addr_t addr, uint64_t value,
unsigned size)
{
MilkymistSysctlState *s = opaque;
trace_milkymist_sysctl_memory_write(addr, value);
addr >>= 2;
switch (addr) {
case R_GPIO_OUT:
case R_GPIO_INTEN:
case R_TI... | 11,323 |
qemu | 369f7de9d57e4dd2f312255fc12271d5749c0a4e | 0 | static void parallels_close(BlockDriverState *bs)
{
BDRVParallelsState *s = bs->opaque;
g_free(s->catalog_bitmap);
}
| 11,324 |
qemu | c919297379e9980c2bcc4d2053addbc1fd6d762b | 1 | static int img_resize(int argc, char **argv)
{
Error *err = NULL;
int c, ret, relative;
const char *filename, *fmt, *size;
int64_t n, total_size;
bool quiet = false;
BlockBackend *blk = NULL;
QemuOpts *param;
static QemuOptsList resize_options = {
.name = "resize_opti... | 11,325 |
FFmpeg | 7fb92be7e50ea4ba5712804326c6814ae02dd190 | 1 | static void qtrle_decode_24bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change)
{
int rle_code;
int pixel_ptr;
int row_inc = s->frame.linesize[0];
unsigned char r, g, b;
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
... | 11,327 |
FFmpeg | e58c05bb3c8b7bd3b93d264facbf290aeae4c483 | 1 | static int xiph_parse_sdp_line(AVFormatContext *s, int st_index,
PayloadContext *data, const char *line)
{
const char *p;
char *value;
char attr[25];
int value_size = strlen(line), attr_size = sizeof(attr), res = 0;
AVCodecContext* codec = s->streams[st_index]... | 11,329 |
FFmpeg | 8fbab7a6c84fd75de4f752b412cea8032604f75b | 1 | static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
AVStream *st, AVPacket *pkt, uint32_t *timestamp,
const uint8_t *buf, int len, uint16_t seq,
int flags)
{
int start_partition, end_packet;
int exte... | 11,330 |
FFmpeg | 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 | 1 | static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
MpegEncContext * const s = avctx->priv_data;
MJpegContext * const m = s->mjpeg_ctx;
AVFrame *pict = data;
const int width= s->width;
const int height= s->height;
AVFrame * const p= (AVF... | 11,331 |
qemu | 3df3e0a5872cbc8fcc55a0413416352eec68132e | 1 | static VFIOGroup *vfio_get_group(int groupid)
{
VFIOGroup *group;
char path[32];
struct vfio_group_status status = { .argsz = sizeof(status) };
QLIST_FOREACH(group, &group_list, next) {
if (group->groupid == groupid) {
return group;
}
}
group = g_malloc0... | 11,332 |
FFmpeg | 4819446eae451a6e58d6ae41faefb5529af4e783 | 1 | static int webvtt_event_to_ass(AVBPrint *buf, const char *p)
{
int i, again, skip = 0;
while (*p) {
for (i = 0; i < FF_ARRAY_ELEMS(webvtt_tag_replace); i++) {
const char *from = webvtt_tag_replace[i].from;
const size_t len = strlen(from);
if (!strncmp(p, fr... | 11,333 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int nuv_probe(AVProbeData *p) {
if (p->buf_size < 12)
return 0;
if (!memcmp(p->buf, "NuppelVideo", 12))
return AVPROBE_SCORE_MAX;
if (!memcmp(p->buf, "MythTVVideo", 12))
return AVPROBE_SCORE_MAX;
return 0;
}
| 11,335 |
qemu | 4380be0e997284159e634100d2f5ec87f944d74d | 1 | void cache_fini(PageCache *cache)
{
int64_t i;
g_assert(cache);
g_assert(cache->page_cache);
for (i = 0; i < cache->max_num_items; i++) {
g_free(cache->page_cache[i].it_data);
}
g_free(cache->page_cache);
cache->page_cache = NULL;
} | 11,336 |
FFmpeg | 3cffbe090a5168dcfe580de8d662a32e7ad1d911 | 1 | int ff_rate_control_init(MpegEncContext *s)
{
RateControlContext *rcc= &s->rc_context;
int i;
const char *error = NULL;
static const char * const const_names[]={
"PI",
"E",
"iTex",
"pTex",
"tex",
"mv",
"fCode",
"iCount",
... | 11,337 |
FFmpeg | 7c453277a399bc81553c6110efd81a0957117138 | 1 | static int iec61883_read_header(AVFormatContext *context)
{
struct iec61883_data *dv = context->priv_data;
struct raw1394_portinfo pinf[16];
rom1394_directory rom_dir;
char *endptr;
int inport;
int nb_ports;
int port = -1;
int response;
int i, j = 0;
uint64_t guid = 0;... | 11,338 |
qemu | 556c2b60714e7dae3ed0eb3488910435263dc09f | 1 | static int aio_flush_f(BlockBackend *blk, int argc, char **argv)
{
blk_drain_all();
return 0;
} | 11,339 |
FFmpeg | 527224830aad6aaf5fc5ed9ff6c5f12c80ff906c | 1 | static int idcin_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
IdcinContext *s = avctx->priv_data;
const uint8_t *pal = av_packet_get_side... | 11,340 |
qemu | 21ef45d71221b4577330fe3aacfb06afad91ad46 | 1 | void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
const char *options;
int password = 0;
int reverse = 0;
#ifdef CONFIG_VNC_TLS
int tls = 0, x509 = 0;
#endif
#ifdef CONFIG_VNC_SASL
int sasl = 0;
... | 11,341 |
qemu | e92f0e1910f0655a0edd8d87c5a7262d36517a89 | 1 | bdrv_rw_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos,
bool is_read)
{
if (qemu_in_coroutine()) {
return bdrv_co_rw_vmstate(bs, qiov, pos, is_read);
} else {
BdrvVmstateCo data = {
.bs = bs,
.qiov = qiov,
... | 11,342 |
FFmpeg | 636ced8e1dc8248a1353b416240b93d70ad03edb | 1 | static void exit_program(void)
{
int i, j;
for (i = 0; i < nb_filtergraphs; i++) {
avfilter_graph_free(&filtergraphs[i]->graph);
for (j = 0; j < filtergraphs[i]->nb_inputs; j++) {
av_freep(&filtergraphs[i]->inputs[j]->name);
av_freep(&filtergraphs[i]->inputs[j]);... | 11,344 |
qemu | 846424350b292f16b732b573273a5c1f195cd7a3 | 1 | static bool scsi_target_emulate_report_luns(SCSITargetReq *r)
{
BusChild *kid;
int i, len, n;
int channel, id;
bool found_lun0;
if (r->req.cmd.xfer < 16) {
return false;
}
if (r->req.cmd.buf[2] > 2) {
return false;
}
channel = r->req.dev->channel;
i... | 11,345 |
qemu | 6265eb26a375179f193f792e4f0d49036d2cf052 | 1 | static int check_directory_consistency(BDRVVVFATState *s,
int cluster_num, const char* path)
{
int ret = 0;
unsigned char* cluster = qemu_malloc(s->cluster_size);
direntry_t* direntries = (direntry_t*)cluster;
mapping_t* mapping = find_mapping_for_cluster(s, cluster_num);
long_file_name lf... | 11,346 |
FFmpeg | 5eeeb4abf9705891f4dd1a4499588428319dec24 | 1 | static int rpl_read_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
RPLContext *rpl = s->priv_data;
AVStream *vst = NULL, *ast = NULL;
int total_audio_size;
int error = 0;
uint32_t i;
int32_t audio_format, chunk_catalog_offset, number_of_chunks;
AVRational fps;
... | 11,347 |
FFmpeg | 5a571d324129ce367584ad9d92aae1d286f389a2 | 1 | static void h264_free_context(PayloadContext *data)
{
#ifdef DEBUG
int ii;
for (ii = 0; ii < 32; ii++) {
if (data->packet_types_received[ii])
av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n",
data->packet_types_received[ii], ii);
}
#endif
... | 11,348 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static void mirror_iteration_done(MirrorOp *op, int ret)
{
MirrorBlockJob *s = op->s;
struct iovec *iov;
int64_t chunk_num;
int i, nb_chunks, sectors_per_chunk;
trace_mirror_iteration_done(s, op->sector_num, op->nb_sectors, ret);
s->in_flight--;
s->sectors_in_flight -= op->nb_sec... | 11,350 |
FFmpeg | 07ef7b1a303680b73fc4a014f74a6d5089725184 | 1 | static int find_image_range(int *pfirst_index, int *plast_index,
const char *path, int start_index)
{
char buf[1024];
int range, last_index, range1, first_index;
/* find the first image */
for (first_index = start_index; first_index < start_index + 5; first_index++) {... | 11,351 |
FFmpeg | dcc39ee10e82833ce24aa57926c00ffeb1948198 | 0 | av_cold int ff_cavs_init(AVCodecContext *avctx)
{
AVSContext *h = avctx->priv_data;
ff_blockdsp_init(&h->bdsp, avctx);
ff_h264chroma_init(&h->h264chroma, 8);
ff_idctdsp_init(&h->idsp, avctx);
ff_videodsp_init(&h->vdsp, 8);
ff_cavsdsp_init(&h->cdsp, avctx);
ff_init_scantable_permuta... | 11,352 |
FFmpeg | c363843a53553cbda6d42d98e8fbd165eda193fb | 0 | static int filter_packet(void *log_ctx, AVPacket *pkt,
AVFormatContext *fmt_ctx, AVBitStreamFilterContext *bsf_ctx)
{
AVCodecContext *enc_ctx = fmt_ctx->streams[pkt->stream_index]->codec;
int ret = 0;
while (bsf_ctx) {
AVPacket new_pkt = *pkt;
ret = av_bitst... | 11,353 |
qemu | ff2b68aa70d10b7eae813b04e9a23723dbd89ebd | 1 | static void nbd_client_close(NBDClient *client)
{
qemu_set_fd_handler2(client->sock, NULL, NULL, NULL, NULL);
close(client->sock);
client->sock = -1;
if (client->close) {
client->close(client);
}
nbd_client_put(client);
}
| 11,355 |
FFmpeg | 99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d | 0 | int avio_close(AVIOContext *s)
{
AVIOInternal *internal;
URLContext *h;
if (!s)
return 0;
avio_flush(s);
internal = s->opaque;
h = internal->h;
av_opt_free(internal);
av_freep(&internal->protocols);
av_freep(&s->opaque);
av_freep(&s->buffer);
... | 11,356 |
FFmpeg | 2f43897f657974d8f94d0d075eb67dac1147ddde | 1 | int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfields_mapping, int global, void *log_ctx)
{
int i, ret = 0;
jclass last_clazz = NULL;
for (i = 0; jfields_mapping[i].name; i++) {
int mandatory = jfields_mapping[i].mandatory;
enum FFJniFieldType type = jfields_ma... | 11,358 |
qemu | 1bf03e66fd03af46ff0f98dd04b6e28f432ac1e3 | 1 | static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
int64_t offset, unsigned int bytes, QEMUIOVector *qiov)
{
BlockDriverState *bs = child->bs;
/* Perform I/O through a temporary buffer so that users who scribble over
* their read buffer while the operation is in progress do n... | 11,360 |
qemu | c919297379e9980c2bcc4d2053addbc1fd6d762b | 1 | static int img_bench(int argc, char **argv)
{
int c, ret = 0;
const char *fmt = NULL, *filename;
bool quiet = false;
bool image_opts = false;
bool is_write = false;
int count = 75000;
int depth = 64;
int64_t offset = 0;
size_t bufsize = 4096;
int pattern = 0;
size... | 11,362 |
qemu | 9561fda8d90e176bef598ba87c42a1bd6ad03ef7 | 1 | void object_property_add_link(Object *obj, const char *name,
const char *type, Object **child,
Error **errp)
{
gchar *full_type;
full_type = g_strdup_printf("link<%s>", type);
object_property_add(obj, name, full_type,
... | 11,363 |
qemu | 89cad9f3ec6b30d7550fb5704475fc9c3393a066 | 1 | static void process_event(JSONMessageParser *parser, QList *tokens)
{
GAState *s = container_of(parser, GAState, parser);
QObject *obj;
QDict *qdict;
Error *err = NULL;
int ret;
g_assert(s && parser);
g_debug("process_event: called");
obj = json_parser_parse_err(tokens, NULL... | 11,364 |
FFmpeg | 90540c2d5ace46a1e9789c75fde0b1f7dbb12a9b | 1 | static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
{
uint8_t *dest = dst;
const uint8_t *s = src;
const uint8_t *end;
const uint8_t *mm_end;
end = s + src_size;
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 31;
while (s... | 11,365 |
FFmpeg | 3511d4fc9784d5fbb024dce68ca7a0d7fdd74663 | 1 | static void slice_thread_park_workers(ThreadContext *c)
{
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
pthread_mutex_unlock(&c->current_job_lock);
}
| 11,366 |
FFmpeg | bf0d7da7cbbf869605086c2a47cdf87f0a533e24 | 0 | static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
{
LJpegEncContext *s = avctx->priv_data;
int chroma_v_shift, chroma_h_shift;
if ((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
avctx->pix_fmt == AV_PIX_FMT_YUV444P) &&
avctx->str... | 11,367 |
qemu | 4a94b3aa6d97dfa67a20c7a0315c9773352f0e8e | 1 | static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
const char *name, int devfn,
Error **errp)
{
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev);
PCIConfigReadFunc *config_read = pc->config_read;
... | 11,369 |
qemu | cb6d3ca07b8f62b47ef30c6a92caa3e8bd71248b | 1 | static void multiwrite_cb(void *opaque, int ret)
{
MultiwriteCB *mcb = opaque;
if (ret < 0) {
mcb->error = ret;
multiwrite_user_cb(mcb);
}
mcb->num_requests--;
if (mcb->num_requests == 0) {
if (mcb->error == 0) {
multiwrite_user_cb(mcb);
}
... | 11,370 |
qemu | 187337f8b0ec0813dd3876d1efe37d415fb81c2e | 1 | qemu_irq *pl190_init(uint32_t base, qemu_irq irq, qemu_irq fiq)
{
pl190_state *s;
qemu_irq *qi;
int iomemtype;
s = (pl190_state *)qemu_mallocz(sizeof(pl190_state));
iomemtype = cpu_register_io_memory(0, pl190_readfn,
pl190_writefn, s);
cpu_registe... | 11,371 |
qemu | eeae2e7b52255dae0976a027b6e11274990c708d | 1 | static void pci_reg_write4(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
PPCE500PCIState *pci = opaque;
unsigned long win;
win = addr & 0xfe0;
pci_debug("%s: value:%x -> win:%lx(addr:" TARGET_FMT_plx ")\n",
__func__, value, win, addr);
... | 11,372 |
qemu | de9de157fbb9aa66380ab1973dd6ecf12fbd8b25 | 1 | static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
uint64_t pictx, bool bsr)
{
XHCISlot *slot;
USBPort *uport;
USBDevice *dev;
dma_addr_t ictx, octx, dcbaap;
uint64_t poctx;
uint32_t ictl_ctx[2];
uint32_t slot_ctx[4];
uint3... | 11,374 |
FFmpeg | c6902f96d75b9786ddc1404c14349d6a22b7ed05 | 1 | static void encode_frame(MpegAudioContext *s,
unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT],
int padding)
{
int i, j, k, l, bit_alloc_bits, b, ch;
unsigned char *sf;
int q[3];
PutBitContext *p = &s->pb;
/* header */
put_bits(p, ... | 11,375 |
FFmpeg | e3faad811e429002d549562db4e0fc30c08dc6a4 | 0 | static int quantize_coefs(double *coef, int *idx, float *lpc, int order)
{
int i;
uint8_t u_coef;
const float *quant_arr = tns_tmp2_map[TNS_Q_BITS == 4];
const double iqfac_p = ((1 << (TNS_Q_BITS-1)) - 0.5)/(M_PI/2.0);
const double iqfac_m = ((1 << (TNS_Q_BITS-1)) + 0.5)/(M_PI/2.0);
for (... | 11,376 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int get_int16(QEMUFile *f, void *pv, size_t size)
{
int16_t *v = pv;
qemu_get_sbe16s(f, v);
return 0;
}
| 11,377 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void compress_to_network(RDMACompress *comp)
{
comp->value = htonl(comp->value);
comp->block_idx = htonl(comp->block_idx);
comp->offset = htonll(comp->offset);
comp->length = htonll(comp->length);
}
| 11,378 |
FFmpeg | 3748b2b8e8bcedba2de7fe826c4094169a885840 | 1 | int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
{
graph->filters = av_realloc(graph->filters,
sizeof(AVFilterContext*) * ++graph->filter_count);
if (!graph->filters)
return AVERROR(ENOMEM);
graph->filters[graph->filter_count - 1]... | 11,379 |
FFmpeg | 0898a6d4e4b669704fce663f610aa43dd7483fe9 | 1 | av_cold int ff_rate_control_init(MpegEncContext *s)
{
RateControlContext *rcc = &s->rc_context;
int i, res;
static const char * const const_names[] = {
"PI",
"E",
"iTex",
"pTex",
"tex",
"mv",
"fCode",
"iCount",
"mcVar",
... | 11,380 |
qemu | ef4c9fc8542e06b1d567172c04b0c0377c7ab0c5 | 1 | void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
TraceEvent *ev, bool state)
{
TraceEventVCPUID vcpu_id;
bool state_pre;
assert(trace_event_get_state_static(ev));
assert(trace_event_is_vcpu(ev));
vcpu_id = trace_event_get_vcpu_id(ev);
state_... | 11,382 |
qemu | 521360267876d3b6518b328051a2e56bca55bef8 | 1 | static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
{
struct vmsvga_state_s *s = opaque;
if (s->index >= SVGA_SCRATCH_BASE) {
trace_vmware_scratch_write(s->index, value);
} else if (s->index >= SVGA_PALETTE_BASE) {
trace_vmware_palette_write(s->index, value... | 11,385 |
FFmpeg | e7a39e163ddbde85f966132194143d0338445a0c | 1 | int main (int argc, char **argv)
{
int ret = 0, got_frame;
if (argc != 4) {
fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n"
"API example program to show how to read frames from an input file.\n"
"This program reads frames from a file, ... | 11,386 |
FFmpeg | 3b199d29cd597a3518136d78860e172060b9e83d | 0 | static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
{
TrueMotion1Context *s = avctx->priv_data;
s->avctx = avctx;
// FIXME: it may change ?
// if (avctx->bits_per_sample == 24)
// avctx->pix_fmt = AV_PIX_FMT_RGB24;
// else
// avctx->pix_fmt = AV_PIX_FMT_RGB555;
... | 11,387 |
FFmpeg | d7b2bb5391bf55e8f9421bff7feb4c1fddfac4bf | 0 | static int h264_export_frame_props(H264Context *h)
{
const SPS *sps = h->ps.sps;
H264Picture *cur = h->cur_pic_ptr;
cur->f->interlaced_frame = 0;
cur->f->repeat_pict = 0;
/* Signal interlacing information externally. */
/* Prioritize picture timing SEI information over used
... | 11,389 |
qemu | d87aa138039a4be6d705793fd3e397c69c52405a | 1 | static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt)
{
int network_header_length = ppkt->ip->ip_hl * 4;
trace_colo_compare_main("compare icmp");
/*
* Because of ppkt and spkt are both in the same connection,
* The ppkt's src ip, dst ip, src port, dst port, ip_proto all are
... | 11,390 |
FFmpeg | c0b91348fe4aec7d2245d95ccabb460a6971e361 | 1 | static int caca_write_header(AVFormatContext *s)
{
CACAContext *c = s->priv_data;
AVStream *st = s->streams[0];
AVCodecContext *encctx = st->codec;
int ret, bpp;
c->ctx = s;
if (c->list_drivers) {
list_drivers(c);
return AVERROR_EXIT;
}
if (c->list_dither) {
... | 11,391 |
FFmpeg | 900f39692ca0337a98a7cf047e4e2611071810c2 | 1 | static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *segment)
{
int i, length;
segment->nb_index_entries = avio_rb32(pb);
length = avio_rb32(pb);
if (!(segment->temporal_offset_entries=av_calloc(segment->nb_index_entries, sizeof(*segment->temporal_offset_entries))) |... | 11,392 |
qemu | 20a579de8484096d18e65751ebe63fee31551f04 | 1 | uint64_t hbitmap_serialization_granularity(const HBitmap *hb)
{
/* Must hold true so that the shift below is defined
* (ld(64) == 6, i.e. 1 << 6 == 64) */
assert(hb->granularity < 64 - 6);
/* Require at least 64 bit granularity to be safe on both 64 bit and 32 bit
* hosts. */
return U... | 11,393 |
qemu | f3c75d42adbba553eaf218a832d4fbea32c8f7b8 | 1 | void helper_store_sdr1(CPUPPCState *env, target_ulong val)
{
ppc_store_sdr1(env, val);
}
| 11,394 |
FFmpeg | 29234f56818135faf2f1868ab324c073abd28fbd | 0 | static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int part1_size, hscale, vscale, i, j, ret;
int width = s->avctx->width;
int height = s->avctx->height;
s->profile = (buf[0] >> 1) & 7;
if (s->profile > 1) {
avpriv_... | 11,395 |
FFmpeg | 171c407621b7ff52a0cf128b31651ca927c2dd49 | 1 | static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square, int chroma_height, int delta, int list,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
int src_x_offset, int src_y_offset,
qpel_mc_func *qpix_op, h264... | 11,396 |
FFmpeg | 371946bc27bd1e874e0302699550ab9926249950 | 1 | static int encode_frame(AVCodecContext *avctx, uint8_t *buf,
int buf_size, void *data)
{
AVFrame *pic = data;
int i, j;
int aligned_width = FFALIGN(avctx->width, 64);
uint8_t *src_line;
uint8_t *dst = buf;
if (buf_size < 4 * aligned_width * avctx->height) {
... | 11,397 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static inline void gen_st32(TCGv val, TCGv addr, int index)
{
tcg_gen_qemu_st32(val, addr, index);
dead_tmp(val);
}
| 11,398 |
qemu | 8ba2aae32c40f544def6be7ae82be9bcb781e01d | 0 | int uuid_is_null(const uuid_t uu)
{
uuid_t null_uuid = { 0 };
return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
}
| 11,399 |
qemu | d7a4155265416a1c8f3067b59e68bf5fda1d6215 | 0 | static int e1000_post_load(void *opaque, int version_id)
{
E1000State *s = opaque;
NetClientState *nc = qemu_get_queue(s->nic);
if (!(s->compat_flags & E1000_FLAG_MIT)) {
s->mac_reg[ITR] = s->mac_reg[RDTR] = s->mac_reg[RADV] =
s->mac_reg[TADV] = 0;
s->mit_irq_level = fal... | 11,401 |
qemu | dc523cd348c47372faa7271c9aab2030f94c290d | 0 | int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname)
{
Error *err = NULL;
opts_do_parse(opts, params, firstname, false, &err);
if (err) {
qerror_report_err(err);
error_free(err);
return -1;
}
return 0;
}
| 11,403 |
qemu | ef29a70d18c2d551cf4bb74b8aa9638caac3391b | 0 | static int cris_mmu_enabled(uint32_t rw_gc_cfg)
{
return (rw_gc_cfg & 12) != 0;
}
| 11,404 |
FFmpeg | 465e1dadbef7596a3eb87089a66bb4ecdc26d3c4 | 0 | static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
{
NUTContext *nut = s->priv_data;
StreamContext *stream;
ByteIOContext *bc = &s->pb;
int size, frame_code, flags, size_mul, size_lsb, stream_id;
int key_frame = 0;
int frame_type= 0;
int64_t pts = 0;
const int64_t fra... | 11,405 |
qemu | 4c241cf5d6ca06c682e033cf8b327b63b1f4b784 | 0 | void block_job_user_resume(BlockJob *job)
{
if (job && job->user_paused && job->pause_count > 0) {
job->user_paused = false;
block_job_iostatus_reset(job);
block_job_resume(job);
}
}
| 11,406 |
qemu | dd673288a8ff73ad77fcc1c255486d2466a772e1 | 0 | static void pc_cpu_reset(void *opaque)
{
X86CPU *cpu = opaque;
CPUX86State *env = &cpu->env;
cpu_reset(CPU(cpu));
env->halted = !cpu_is_bsp(env);
}
| 11,407 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static pflash_t *ve_pflash_cfi01_register(hwaddr base, const char *name,
DriveInfo *di)
{
DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
if (di && qdev_prop_set_drive(dev, "drive",
blk_bs(blk_by_legacy_dinfo(di)))) {
... | 11,408 |
qemu | dd3dd4ba7b949662d2c67a4c041549b3d79c4b0e | 0 | static bool virtio_queue_host_notifier_aio_poll(void *opaque)
{
EventNotifier *n = opaque;
VirtQueue *vq = container_of(n, VirtQueue, host_notifier);
bool progress;
if (virtio_queue_empty(vq)) {
return false;
}
progress = virtio_queue_notify_aio_vq(vq);
/* In case the ... | 11,409 |
qemu | a980f7f2c2f4d7e9a1eba4f804cd66dbd458b6d4 | 0 | static void qvirtio_9p_stop(void)
{
qtest_end();
rmdir(test_share);
g_free(test_share);
}
| 11,410 |
qemu | 54bf36ed351c526cde0c853079f9ff1ab7e2ff89 | 0 | do_kernel_trap(CPUARMState *env)
{
uint32_t addr;
uint32_t cpsr;
uint32_t val;
switch (env->regs[15]) {
case 0xffff0fa0: /* __kernel_memory_barrier */
/* ??? No-op. Will need to do better for SMP. */
break;
case 0xffff0fc0: /* __kernel_cmpxchg */
/* XXX: Thi... | 11,411 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | static void event_notifier_dummy_cb(EventNotifier *e)
{
}
| 11,412 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | uint16_t cpu_inw(CPUState *env, pio_addr_t addr)
{
uint16_t val;
val = ioport_read(1, addr);
LOG_IOPORT("inw : %04"FMT_pioaddr" %04"PRIx16"\n", addr, val);
#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
return val;
}
| 11,413 |
qemu | cf7c0ff521b0710079aa28f21937fb7dbb3f5224 | 0 | static NVDIMMDevice *nvdimm_get_device_by_handle(uint32_t handle)
{
NVDIMMDevice *nvdimm = NULL;
GSList *list, *device_list = nvdimm_get_plugged_device_list();
for (list = device_list; list; list = list->next) {
NVDIMMDevice *nvd = list->data;
int slot = object_property_get_int(OBJEC... | 11,415 |
FFmpeg | f495fbe76a2665cdea092999ca2dbb603d13280c | 0 | int avio_check(const char *url, int flags)
{
URLContext *h;
int ret = ffurl_alloc(&h, url, flags, NULL);
if (ret)
return ret;
if (h->prot->url_check) {
ret = h->prot->url_check(h, flags);
} else {
ret = ffurl_connect(h, NULL);
if (ret >= 0)
re... | 11,416 |
qemu | e2a32ebbfe899a32a6b063f0f9e7c2593267ea88 | 0 | int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
int is_write1, int mmu_idx)
{
X86CPU *cpu = X86_CPU(cs);
CPUX86State *env = &cpu->env;
uint64_t ptep, pte;
target_ulong pde_addr, pte_addr;
int error_code = 0;
int is_dirty, prot, page_size, is_write, is_... | 11,417 |
qemu | 96c9cff0ab986f3a0606e1a96c5b00e6a7c675c6 | 0 | int kvmppc_reset_htab(int shift_hint)
{
uint32_t shift = shift_hint;
if (!kvm_enabled()) {
/* Full emulation, tell caller to allocate htab itself */
return 0;
}
if (kvm_check_extension(kvm_state, KVM_CAP_PPC_ALLOC_HTAB)) {
int ret;
ret = kvm_vm_ioctl(kvm_state,... | 11,418 |
FFmpeg | f0f2218dce194ff50d1fe7ed39011595660143ad | 0 | static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
int ret;
st = av_new_stream(c->fc, c->fc->nb_streams);
if (!st) return AVERROR(ENOMEM);
sc = av_mallocz(sizeof(MOVStreamContext));
if (!sc) return AVERROR(ENOMEM);
... | 11,419 |
FFmpeg | 1acd7d594c15aa491729c837ad3519d3469e620a | 0 | static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,
const int16_t *block,
ptrdiff_t stride)
{
int i;
for(i=0; i<4; i++)
FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16... | 11,420 |
FFmpeg | 465e1dadbef7596a3eb87089a66bb4ecdc26d3c4 | 0 | void init_checksum(ByteIOContext *s, unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum){
s->update_checksum= update_checksum;
s->checksum= s->update_checksum(checksum, NULL, 0);
s->checksum_ptr= s->buf_ptr;
}
| 11,421 |
FFmpeg | bd6fa80d56fcda385da1c8f21eb83282a7930899 | 0 | static av_cold int hap_init(AVCodecContext *avctx)
{
HapContext *ctx = avctx->priv_data;
int ratio;
int corrected_chunk_count;
int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid video size %dx%d.\n",
... | 11,422 |
FFmpeg | fa0f62c37d90c0760bddccba2054578e2c61ae1a | 0 | static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,
const uint8_t *buf, int size, int64_t pts)
{
MpegMuxContext *s = ctx->priv_data;
AVStream *st = ctx->streams[stream_index];
StreamInfo *stream = st->priv_data;
int len;
while (size ... | 11,424 |
FFmpeg | 13c56e9a9cf18f33bcbc2dc1a5cf2a5f98ca9702 | 0 | static int decode_i_block(FourXContext *f, int16_t *block)
{
int code, i, j, level, val;
if (get_bits_left(&f->gb) < 2){
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
return -1;
}
/* DC coef */
val = get_vlc2(&f->pre_gb, ... | 11,425 |
FFmpeg | 52069c4d3c92f68605fadf012ab0da594ee9bae4 | 0 | static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
const uint8_t **buf, int buf_size)
{
MpegEncContext *s = &s1->mpeg_enc_ctx;
AVCodecContext *avctx= s->avctx;
const int field_pic= s->picture_structure != PICT_FRAME;
const int lowres= s->avctx->lowres;
s->... | 11,426 |
FFmpeg | 4bff9ef9d0781c4de228bf1f85634d2706fc589b | 0 | static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= width>>1;
#ifdef HAVE_MMX
for(y=0; y<height-2; y+=2)
{
long i;
for(i=0; i<2; i++)
{
... | 11,429 |
FFmpeg | 456f0c6477925611f1b45a434795f8bad4fb2a66 | 0 | static int paf_vid_decode(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *pkt)
{
PAFVideoDecContext *c = avctx->priv_data;
uint8_t code, *dst, *src, *end;
int i, frame, ret;
c->pic.reference = 3;
if ((ret = avctx->reget_buffer(avctx, &c->pic)) < 0)
... | 11,430 |
FFmpeg | a8f171151f0f027abb06f72e48c44929616a84cb | 0 | static int file_read(URLContext *h, unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
int r = read(c->fd, buf, size);
return (-1 == r)?AVERROR(errno):r;
}
| 11,431 |
qemu | 07caea315a85ebfe90851f9c2e4ef3fdd24117b5 | 1 | static void realview_init(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
ram_addr_t ram_offset;
DeviceState *dev;... | 11,432 |
FFmpeg | bc38e83793be5f7a184c88be55e556453a25224b | 1 | int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
const uint8_t *buf, int len)
{
int len1;
len1 = len;
ts->pkt = pkt;
ts->stop_parse = 0;
for(;;) {
if (ts->stop_parse>0)
break;
if (len < TS_PACKET_SIZE)
return -1... | 11,434 |
FFmpeg | c31b81216619e6b3d986ce63c82357993e10e8e9 | 1 | static int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr)
{
unsigned char *destptr_bak = destptr;
unsigned char mask = 0;
unsigned char maskbit = 0;
unsigned int ofs, cnt;
while (srclen > 0) {
if (maskbit == 0) {
mask = *(srcptr++);
... | 11,435 |
FFmpeg | 58720ebd9e671f654d89d8e401d0b4dffb79122b | 1 | int ff_split_xiph_headers(uint8_t *extradata, int extradata_size,
int first_header_size, uint8_t *header_start[3],
int header_len[3])
{
int i, j;
if (AV_RB16(extradata) == first_header_size) {
for (i=0; i<3; i++) {
header_len[i] = ... | 11,436 |
FFmpeg | 44ae98ddef565e03080012bb22467bc7ed1ca1d2 | 1 | static int vp3_decode_init(AVCodecContext *avctx)
{
Vp3DecodeContext *s = avctx->priv_data;
int i;
s->avctx = avctx;
s->width = avctx->width;
s->height = avctx->height;
avctx->pix_fmt = PIX_FMT_YUV420P;
avctx->has_b_frames = 0;
dsputil_init(&s->dsp, avctx);
/* initializ... | 11,437 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | uint16_t qpci_io_readw(QPCIDevice *dev, void *data)
{
uintptr_t addr = (uintptr_t)data;
if (addr < QPCI_PIO_LIMIT) {
return dev->bus->pio_readw(dev->bus, addr);
} else {
uint16_t val;
dev->bus->memread(dev->bus, addr, &val, sizeof(val));
return le16_to_cpu(val);
... | 11,438 |
FFmpeg | 0146c1f0f173417b2b90f35a2fdf87604cf9227a | 0 | int avfilter_config_links(AVFilterContext *filter)
{
int (*config_link)(AVFilterLink *);
unsigned i;
int ret;
for (i = 0; i < filter->nb_inputs; i ++) {
AVFilterLink *link = filter->inputs[i];
AVFilterLink *inlink = link->src->nb_inputs ?
link->src->inputs[0] : NULL... | 11,440 |
FFmpeg | 4bff9ef9d0781c4de228bf1f85634d2706fc589b | 0 | static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width)
{
#ifdef HAVE_MMX
asm volatile(
"mov %2, %%"REG_a" \n\t"
"movq "MANGLE(bgr2YCoeff)", %%mm6 \n\t"
"movq "MANGLE(w1111)", %%mm5 \n\t"
"pxor %%mm7, %%mm7 \n\t"
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_b"\n\t"
ASMALIGN16
... | 11,441 |
FFmpeg | a3d2379bdd821eec60f20ee3945047d659894bda | 0 | static inline int decode_subframe(FLACContext *s, int channel)
{
int type, wasted = 0;
int i, tmp;
s->curr_bps = s->bps;
if (channel == 0) {
if (s->decorrelation == RIGHT_SIDE)
s->curr_bps++;
} else {
if (s->decorrelation == LEFT_SIDE || s->decorrelation == MID... | 11,442 |
FFmpeg | 892fc83e88a20f9543c6c5be3626712be7a2e6f2 | 0 | static void unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
{
int bit = 0;
int current_superblock = 0;
int current_run = 0;
int decode_fully_flags = 0;
int decode_partial_blocks = 0;
int i, j;
int current_fragment;
debug_vp3(" vp3: unpacking superblock coding\n")... | 11,443 |
FFmpeg | 7b9fc769e40a7709fa59a54e2a810f76364eee4b | 0 | static int svq1_decode_delta_block(MpegEncContext *s, GetBitContext *bitbuf,
uint8_t *current, uint8_t *previous,
int pitch, svq1_pmv *motion, int x, int y)
{
uint32_t block_type;
int result = 0;
/* get block type */
block_ty... | 11,445 |
FFmpeg | 68f593b48433842f3407586679fe07f3e5199ab9 | 0 | int ff_h263_decode_mb(MpegEncContext *s,
DCTELEM block[6][64])
{
int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
INT16 *mot_val;
static INT8 quant_tab[4] = { -1, -2, 1, 2 };
s->error_status_table[s->mb_x + s->mb_y*s->mb_width]= 0;
if(s->mb_x==0) PRINT_MB_TYPE... | 11,447 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.